redirecting with php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • killSwitch
    New Member
    • Mar 2007
    • 1

    #1

    redirecting with php

    I want to redirect by linking to something like http://example.com/redir.php?goto= google.com

    what i've tried so far has failed. it redirects me to http://www..com instead of google.

    Here's my redir.php:

    Code:
     
    <?php 
    header("Location: http://www.$goto");   
    
    exit; 
    ?>
    what's wrong with this?

    Thanks
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Well, what is the value of the variable $goto. I'll bet it is '.com'. Show it.

    When you want to redirect to that site, the variable must contain
    Code:
    example.com/redir.php?goto=google.com
    and it will redirect you to script redir.php.

    Ronald :cool:

    Comment

    Working...