php - URL Redirection, with target location stored in a variable -
i have problem redirecting page, when target location stored in variable.
this code works:
header('location:demo.php');
but code doesn't work:
$ss='demo.php'; header('location:$ss');
why? thank help.
you have use double quotes here. php parse text inside double quotes.
if type example
echo '$text\n';
it not output variables content, nor newline. corect be:
echo "$test\n";
Comments
Post a Comment