Send parameters using php file_get_content function -
dear all,
how send parameters using php file_get_content function.
$id='123'; $name='blah'; $response=file_get_contents('http://localhost/abc/abc.php?id=$id&name=$name'); echo $response;
i need send $id , name value abc.php page.here value passing does not working.also chk ?id="$id"&name="$name" value.it's not working. straite parameter works.say-
$response=file_get_contents('http://localhost/abc/abc.php?id=123&name=blah');
now kind heart can me send 2 parameters $id , $name abc.php?
thanks
riad
single quotes inhibit variable substitution.
$response=file_get_contents("http://localhost/abc/abc.php?id=$id&name=$name");
don't forget url-encode parameters though.
Comments
Post a Comment