Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.


    • CommentAuthorjustnajm
    • CommentTimeDec 4th 2006
     
    Hi,

    Php question, I want to redirect to the index.php by checking reference from 2 pages, as if they are from first.php or second.php then its ok let them view the page if not from one of them then redirect to index.php such as:


    $ref = split('/',$_SERVER['HTTP_REFERER']);
    if($ref[count($ref)-1] != 'first.php' | $ref[count($ref)-1] != 'second.php'){
    header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/index.php");
    }

    or

    $ref = split('/',$_SERVER['HTTP_REFERER']);
    if($ref[count($ref)-1] != 'first.php'){
    header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/index.php");
    } else if($ref[count($ref)-1] != 'second.php'){
    header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/index.php");
    }


    But both of this method are sending me to the index page. Either I go through first.php page or second.php page...

    Thanks,

    Najm.