adv Posted October 29, 2007 Share Posted October 29, 2007 hello i have a problem lets say i wanna connect to a site with the user and password via curl $url = "www.site.com"; $ch = curl_init(); curl_setopt($ch , CURLOPT_URL, $url); curl_setopt($ch , CURLOPT_USERAGENT, $browsertype); curl_setopt($ch , CURLOPT_POST ,1 ); curl_setopt($ch , CURLOPT_POSTFIELDS ,$postfields); curl_setopt($ch , CURLOPT_FOLLOWLOCATION ,1 ); curl_setopt($ch , CURLOPT_RETURNTRANSFER, 1 ); curl_setopt($ch , CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch , CURLOPT_COOKIEJAR,$cookie); curl_setopt($ch , CURLOPT_COOKIEFILE ,$cookie); $result = curl_exec($ch); curl_close($ch); echo $result; ?> and at the postfields the site has the username and passwod <input name="username" and same with password but the submit button doesn`t have any name it`s empty how do i connect to that site without submit button and again does it really necessary to use in postfields the name for submit button or is there another way thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/ Share on other sites More sharing options...
rajivgonsalves Posted October 29, 2007 Share Posted October 29, 2007 you will have to connect to page its posting data too seen in the <form action="..."> Quote Link to comment https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/#findComment-380127 Share on other sites More sharing options...
adv Posted October 29, 2007 Author Share Posted October 29, 2007 i don`t quite understand what are u saying :| <form name="Login" method="post" onSubmit="javascript: return logintest(this);"> this is it`s form it doesn`t have action="' only some hidden fields i can`t quite understand u Quote Link to comment https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/#findComment-380193 Share on other sites More sharing options...
adv Posted October 29, 2007 Author Share Posted October 29, 2007 *bump* Quote Link to comment https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/#findComment-380279 Share on other sites More sharing options...
MadTechie Posted October 29, 2007 Share Posted October 29, 2007 if the submit button is nameless then don't add that into the field list (array $postfields)..! Quote Link to comment https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/#findComment-380287 Share on other sites More sharing options...
adv Posted October 29, 2007 Author Share Posted October 29, 2007 yes but it won`t work thats what i`m saying i have the input name for username and password but it won`t do nothing when i echo the result nothing happens.. it returns the original link Quote Link to comment https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/#findComment-380377 Share on other sites More sharing options...
adv Posted October 30, 2007 Author Share Posted October 30, 2007 *bump* Quote Link to comment https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/#findComment-381445 Share on other sites More sharing options...
adv Posted October 30, 2007 Author Share Posted October 30, 2007 hmmm nobody is answering .... let`s say i have an example https://online.lloydstsb.co.uk/customer.ibc this one has and image button submit and are alot of sites like this how do u log on it with curl ?! please help Quote Link to comment https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/#findComment-381469 Share on other sites More sharing options...
GingerRobot Posted October 30, 2007 Share Posted October 30, 2007 You'll need to do a little more work to find out what parameters need to be passed. Try using firefox and the live http headers extension: http://livehttpheaders.mozdev.org/ Hopefully with that you will be able to see where the form takes you, and any other parameters that are being set, perhaps with javascript. Quote Link to comment https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/#findComment-381480 Share on other sites More sharing options...
adv Posted October 31, 2007 Author Share Posted October 31, 2007 thanks alot Ginger i`ll try to work on it Quote Link to comment https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/#findComment-381768 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.