mr_mind Posted January 12, 2008 Share Posted January 12, 2008 Alright I am trying to get cURL to do something for me, and i need a little help with this. What I do not understand is how to set the CURLOPT_POSTFIELDS. Obviously this pulls the response text from that page but I have not yet been able to set the CURLOPT_POSTFIELDS to a postable value, my question is, do i need to set this to the name of an input in a form or do i need to right something special here? <?php $curl_init = curl_init('http://www.example.com/test/recieve.php'); curl_setopt($curl_init, CURLOPT_TIMEOUT, 60); curl_setopt($curl_init, CURLOPT_POST, TRUE); curl_setopt($curl_init, CURLOPT_POSTFIELDS, 'sometext'); curl_exec($curl_init); curl_close($curl_init); ?> Link to comment https://forums.phpfreaks.com/topic/85637-curl/ Share on other sites More sharing options...
Ken2k7 Posted January 12, 2008 Share Posted January 12, 2008 You know how in URLs there is something attached to the end of the URL like: http://www.domain.com/index.php?action=post;topic=12125 . You would put the bolded part there. Link to comment https://forums.phpfreaks.com/topic/85637-curl/#findComment-437040 Share on other sites More sharing options...
mr_mind Posted January 12, 2008 Author Share Posted January 12, 2008 That would be the GET protocol and as far as i can tell what i am trying to do is through the POST protocol Link to comment https://forums.phpfreaks.com/topic/85637-curl/#findComment-437057 Share on other sites More sharing options...
snk Posted January 12, 2008 Share Posted January 12, 2008 That would be the GET protocol and as far as i can tell what i am trying to do is through the POST protocol Did you try it and doesnt work? if you find the answer, please post it here as well, coz its interesting Link to comment https://forums.phpfreaks.com/topic/85637-curl/#findComment-437138 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.