if I want to use http_get in order to do the following get request:
should it look like?:
$result=http_get("http://www.example.com/", array("user"=>"bob","password"=>"password"), $info);
$result=http_get("http://example.com?user=bob&password=password", , $info);
The second one would be passing the get vars. I'm not sure what would happen if you did it the first way...but I would imagine you would get an error.
Originally Posted by criterion9
$user = $_GET['user'];
$password = $_GET['password'];
and then what?
Originally Posted by Dasher
how should the http_get command look like?
If what you are trying to do is extract variables from a url there is no need to use http_get. Just use the global variable $_GET.
One should also sanitize the input. So maybe this would be better;
$user = mysql_escape_string($_GET['user']);
$password = mysql_escape_string($_GET['password']);
On the other hand one does not normally want to expose user names and passwords in plain text in a url. Hopefully those are only examples of what you are trying to do.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)