Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dynamic Redirect Script

    Is coding a script that redirects your to the previous site's last access directory possible?

    For instance...

    www.somesite.com/directory/file.php?1233=k9234 - This is the website that you came from.

    The redirect needs to point to www.somesite.com/directory/ only.

    Any help would be appreciated as I'm not very experienced in coding php. I am very much interested in learning, that's why I'm here.

  • #2
    New Coder
    Join Date
    Dec 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    $_SERVER['HTTP_REFERER'] does not always work (read: doesn't work most of the time).
    If previous location was from your site then you'd set another variable which will act as a referer.
    For example: http://www.somesite.com/directory/fi...efer=directory
    The script will look for 'refer' variable and will redirect the user back to 'directory'


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •