问题描述:

I have a form that posts to another page on this page it processes the form and redirects me but what i am trying to do is add a variable to the url

The line that redirects me

header('Location: landing.php?url=$url');

You see im trying to go to landing.php?url=the-domain-thats-entered-into-the-form

It will not work but if I remove the above line and put the following after the code

<? echo "$url"; ?>

it shows up fine, this is leading me to think i am missing something basic

网友答案:

Variables under single quotes will not be parsed. Try like this [Use double quotes instead]

header("Location: landing.php?url=$url");
       ^---  Use Double Quotes   -----^
相关阅读:
Top