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. Quote Link to comment 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. Quote Link to comment 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%2Bdatacenter@gmail.com") 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.