astralaaron Posted February 12, 2010 Share Posted February 12, 2010 Is it possible to do the same thing as this:header('location:example.php?mode=1&id=1');but instead send variables in a POST array instead of GET?*EDIT - without using a <form>*EDIT2:I think paypal does this on their instant notification.. can someone help me understand how to use the fsocketopen?// post back to PayPal system to validate$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";$header .= "Content-Type: application/x-www-form-urlencoded\r\n";$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);*EDIT3.. I am reading around about it I dont get which headers I need to use and why*EDIT4 - I just thought of a problem, is there a way to actually send the user along with this post data? Link to comment Share on other sites More sharing options...
jeffman Posted February 12, 2010 Share Posted February 12, 2010 The cURL library might be worth exploring. curl_setopt does the heavy lifting. There are a lot of options, and they are not organized in the best way, but they are there, and they do a lot of things. Link to comment Share on other sites More sharing options...
justsomeguy Posted February 12, 2010 Share Posted February 12, 2010 *EDIT4 - I just thought of a problem, is there a way to actually send the user along with this post data?Yeah, with a form submitted through Javascript. PHP works on the server, it really doesn't have anything to do with the user. Any post request from PHP will not affect the user. Link to comment Share on other sites More sharing options...
astralaaron Posted February 13, 2010 Author Share Posted February 13, 2010 thanks guys, I went ahead and used GET array for now but I appreciate the info. going to check into it for future projects. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.