Jump to content

Simple Changes To Code Needed Please


johnsmith153

Recommended Posts

How would I change this, so cURL sends/can use the current $_SESSION values? (by default the code I have posted here - the page cURL accesses wont be able to access $_SESSION values.)

 

Something to do with sending the cookies.

 

I have tried, and people have posted links. So, call it lazy of me if you want, but I would just appreciate an answer "change this to this" - then call me lazy.

 

Thanks.

 

$post_fields="var1=1&var2=5&var3=";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.site.com/page.php');
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response_string = curl_exec($ch);
curl_close($ch);

Link to comment
https://forums.phpfreaks.com/topic/130067-simple-changes-to-code-needed-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.