What is the correct syntax to add a variable to a query string using the GET method of a form? I am trying to pass a dynamic variable ('$username'). Here is my code:
header("Location: menu_short.php?name=$username");
I think I have to add an ECHO but I don't know the correct syntax. Any help is appreciated.
[man]header[/man] requires a full URL:
header("location: http://www.jip.com/menu_short.php?name=$username");
you may need to [man]urlencode[/man] $username
No. You probably want this:
<?php header('Location: http://www.domain.com/menu_short.php?name='.urlencode($username)); ?>
That will return you to a place that has the username in the url, rather than the string "$username"
~Brett
Thanks for the feedback.