1

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

1 Answer 1

3

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

header("Location: landing.php?url=$url");
       ^---  Use Double Quotes   -----^
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.