Thanks to the Easycurl class, you can do your simple curl transactions with very little code information.
With the sample below, you can find examples such as connecting data with proxy and posting the data on a site.
We would be very pleased if you contribute to the development.
If you want to use the proxy with the class, specify the proxy you want to use while specify the proxy: Port. So the proxyadrea is in the second () and then the port number.
require_once " easyCurl.php " ;
$ easyCurl = new easyCurl (); /*
* Sayfa Kaynak kodlarını alma
* SourceCode Fonksiyonuna adresi tanımlayarak kaynak kodlarını alıp değişkene aktarabilirsiniz veya ekrana yansıtabilirsiniz.
* Referans adresi vs.. düzenlemek için bu fonksiyondan önce referer gibi değişkenlere değer vermelisiniz.
* Proxy kullanmak için 2. bir parametrede proxy adresini belirtmeniz yeterlidir. proxyip:sifre şeklinde göndermelisiniz
*/
$ source = $ easyCurl -> sourceCode ( ' http://savascanaltun.com.tr ' ); $ source = $ easyCurl -> sourceCode ( ' http://savascanaltun.com.tr ' , ' 122.323.32.22:8082 ' );In the first parameter, give the Action section of the page to be posted. The form in the sample below was made according to the title and message fields. If you have a example of username and password areas, you must adjust it accordingly.
/*
* CURL POST İşlemi
* post yapılacak formdaki action alanındaki adres
* ikinci parametrede ise bir dizi gönderip bu diziyi form name ve değerlerine göre göndertiniz.
* Proxy kullanmak için 3. bir parametrede proxy adresini belirtmeniz yeterlidir. proxyip:sifre şeklinde göndermelisiniz
*/
$ postData = array (
' baslik ' => ' easyCurl Class test ' ,
' mesaj ' => ' Merhaba ben savaş can altun bu bizim ilk testimiz. '
);
$ post = $ easyCurl -> curlPost ( ' http://savascanaltun.com.tr/app/php/test/post.php ' , $ postData ); $ easyCurl -> referer = " http://savascanaltun.com.tr " ; $ easyCurl -> followlocation = true ; $ easyCurl -> header = true ; $ easyCurl -> timeout = 5 ; $ easyCurl -> ssl_verifypeer = true ;
$ easyCurl -> ssl_verifyhost = true ; $ easyCurl -> cookie = true ;Reaching the number of errors;
$ easyCurl -> errorNumber ;Reaching error;
$ easyCurl -> error ; $ easyCurl -> speed ;Author: Savas Can Altun Mail: [email protected] Web: http://savascanaltun.com.tr