As title mentioned,
for example, I want to send a get request to a permanent link(etc http://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.
Edit/Delete Message
How To Send A GET Request to HTTP using PHP
Moderator: General Moderators
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: How To Send A GET Request to HTTP using PHP
How do you want the result to be returned?
Use
Use
Code: Select all
$page = file('www.google.com?a='.$a);Re: How To Send A GET Request to HTTP using PHP
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 +(%2B) sign. How can i solve it, so that the browser can interpret + as %2B?
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 +(%2B) sign. How can i solve it, so that the browser can interpret + as %2B?
Re: How To Send A GET Request to HTTP using PHP
Get vars should be url encoded. Use urlencode()