receiver19 Posted May 20, 2009 Share Posted May 20, 2009 As title mentioned, for example, I want to send a get request to a permanent link(etc www.google.com) using php, the outcome will become google.com?0=name? form is not the proper step, as in i need to type in the name. How do i send a request to http using php? Thanks. Link to comment https://forums.phpfreaks.com/topic/158854-how-to-send-a-get-request-to-http-using-php/ Share on other sites More sharing options...
michaellunsford Posted May 20, 2009 Share Posted May 20, 2009 http://us2.php.net/curl_exec $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "google.com?0=name"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $curl_res = curl_exec($ch); curl_close($ch); results stored in $curl_res variable. Link to comment https://forums.phpfreaks.com/topic/158854-how-to-send-a-get-request-to-http-using-php/#findComment-837857 Share on other sites More sharing options...
receiver19 Posted May 20, 2009 Author Share Posted May 20, 2009 Thanks for the reply. However, 1. curl_setopt($ch, CURLOPT_URL, "http://example.com?0=". $email ."") 2. curl_setopt($ch, CURLOPT_URL, "http://example.com?0=abc%[email protected]") it works on the second, however the first one is not working. I think is the + sign. How can i solve it so that the browser interpret + as %2B? Link to comment https://forums.phpfreaks.com/topic/158854-how-to-send-a-get-request-to-http-using-php/#findComment-837940 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.