How to redirect back? Big problem

Discussion in 'PHP' started by Tom12361, Mar 21, 2009.

  1. #1
    There is a one good javascript:
    <a href='javascript:history.back()'><b>Go back</b></a>
    He returns you back to the latest page you've seen if you click on "Go back".
    But I have problem, I need to make visitor go back without any clicking and I can't give any url's. So I can't use header or meta-refresh or smth like this. So, any other ideas?
    BTW, do not offer me Ajax, I need script on php or javascript.
     
    Tom12361, Mar 21, 2009 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    Php: $_server['http_referer'];
     
    EricBruggema, Mar 22, 2009 IP
  3. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #3
    if ( the problem occurs ) {
    
    header('location: '.$_SERVER['HTTP_REFERER']);
    
    }
    PHP:
    - ads2help
     
    ads2help, Mar 22, 2009 IP
  4. Tom12361

    Tom12361 Active Member

    Messages:
    442
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #4
    Thank you ;)
     
    Tom12361, Mar 22, 2009 IP