Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/75159-solved-some-help-plz/#findComment-381480
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.