php - Curl to check logins entered -


i'm trying use php script put logins , passwords , test right username , password, can show me how can please?

username=user1, password=passuser1, gender=1 

to example.com

and after i'm assuming curl return me response correct or ok.

note: process must done more 20 or 30 times. 

i give hint on how it, not you, because trying brute force website , can't example:

<?php // // simple php example sends http post remote site //  $ch = curl_init();  curl_setopt($ch, curlopt_url,"http://www.example.com/tester.phtml"); curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields,             "postvar1=value1&postvar2=value2&postvar3=value3");  // in real life should use like: // curl_setopt($ch, curlopt_postfields,  //          http_build_query(array('postvar1' => 'value1')));  // receive server response ... curl_setopt($ch, curlopt_returntransfer, true);  $server_output = curl_exec ($ch);  curl_close ($ch);  // further processing .... if ($server_output == "ok") { ... } else { ... }  ?> 

if need more examples can @ php manual: http://php.net/manual/en/book.curl.php


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -