Reputation: 69
I have problem in redirecting my url.
I have url:-
http://example.com/r/index.php?id=1234
it gives me value of url from database.I store the value of url in $url_link.
On the same page,after db operation.I add the redirect code in body part.
<?php
header('Location: http://$url_link');
?>
which doesnt take the value $url_link.
Upvotes: 1
Views: 61
Reputation: 68546
Enclose in double quotes.. Variables inside single quotes will not get interpreted.
Do like this...
<?php
header("Location: http://$url_link");
?>
Upvotes: 2
Reputation: 1666
It should be something like this.
<?php
header('Location: http://'.$url_link);
?>
Upvotes: 3