PHP echo in a redirect tag

Discussion in 'PHP' started by Evolv5, Aug 20, 2007.

  1. #1
    Hey there,
    so basically, I want users who go to /test.php?abc=http://www.google.com
    to be redirected to http://www.google.com.
    I tried it with the following code placed on test.php:
    I tried it with a javascript redirect, along with a php header redirect, none of which worked. I also tried messing around with the echo tag, but didn't get that to work either. I don't see what I'm doing wrong, as I used to be able to get it to work. :eek:

    Thanks in advance for any help!

    -William
     
    Evolv5, Aug 20, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Variable names cannot start with numbers. Rename it to something similar to:
    
    $_456 = $_POST['123'];
    
    PHP:
     
    nico_swd, Aug 20, 2007 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #3
    Oh, and to get variables from the URL, you have to use $_GET instead of $_POST.
     
    nico_swd, Aug 20, 2007 IP
    Evolv5 likes this.
  4. Evolv5

    Evolv5 Well-Known Member

    Messages:
    777
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    110
    #4
    Silly me, but I just happened to write the numbers here on the forum, In my actual script, they're letters.

    Thanks anyway.
     
    Evolv5, Aug 20, 2007 IP
  5. Evolv5

    Evolv5 Well-Known Member

    Messages:
    777
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    110
    #5
    Oh yeah :D
    Thanks a million, you're a god! +rep!
     
    Evolv5, Aug 20, 2007 IP