I've never touched cURL but I think I am going to get my feet wet! How do I submit multiple requests to post.php? For example: Post: id = 4 Post: id = 5 Post: id = 1 If it makes any difference, I do not want to need to get a response from the server...
The value for id would get overwritten each time. A variable cannot have multiple values unless it's an array. Or do you want to send them one by one? In this case do: $ids = array(1, 4, 5); $ch = curl_init('http://localhost/post.php'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); foreach ($ids AS $id) { curl_setopt($ch, CURLOPT_POSTFIELDS, "id={$id}"); curl_exec($ch); } PHP:
nico - yes I want to send each request... so 3 POSTs.... I've having trouble dealing with the session variables as the page POSTing to alters the session array.... how do I send/get the session variables?
I believe when I did this, it worked... in the sense that when I saw output from my third request, it held data from my first request. HOWEVER, it did not translate back to my original page...
Maybe this? curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); PHP: If not, I don't think what you mean by "translate back to my original page".
I mean, if I make my 2nd request it still has data from the first request. If I send my third request, it still has the previous 2 (as is what I want). HOWEVER, it DOES NOT have my EXISTING session data prior to my first request nor do I see how to get the session data set and apply it to current $_SESSION array... they are different session Ids I think...