Can I pass a var inside of a location tag (inside PHP)?

All my code is working, except for this:

$code = "xxx";
$url = "$code";

It just refreshes the page. I also tried:


It works, but does NOT pass the var…

Help please!

header("Location:" . $code);

though you should be able to do this and I don’t know if the above would even work???

header("Location: index.php?code=" . $code);

Which would be better

if (isset($_GET['code']) {
    echo $_GET['code'];

Your first example was what I needed. Worked perfectly! Thanks very much! :smiley:

Sponsor our Newsletter | Privacy Policy | Terms of Service