Results 1 to 7 of 7

Thread: Ok you scripting brainiacs..here's one for you

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default

    login.php

    Code:
    $come_from = $_SERVER['HTTP_REFERER'];
    
    if ($come_from == "site.com/login.php"){
    
    $redirect_url = $config['baseurl'] . '/' . $user_info['user_name'];
    
    }else{
    
    $redirect_url = javascript:history.go(-2);
    
     redirect($redirect_url)
    
    }
    $_SERVER['HTTP_REFERER'] isnt the best tracker to use for internal pages but the if else will prevent any bugs
    Last edited by carefree2; 05-15-2009 at 03:01 AM.

  2. #2
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    Oh hey thanks, can't wait to give it a whirl!!
    If it's not fun, stop doing it!

  3. #3
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    No matter where I insert that code, I get this:

    Parse error: syntax error, unexpected ':' in /home/j

    ...which is the line about the history..but this gives me a good place to start learning...google, here I come.
    If it's not fun, stop doing it!

Bookmarks

Posting Permissions

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