Need a header menu

Discussion in 'Programming' started by lumpy, Dec 5, 2009.

  1. #1
    Hey. I need a header menu something like this here: Click

    The menu to be what I want and to redirect the other page to another site.

    How do I do it ?
     
    lumpy, Dec 5, 2009 IP
  2. krishmk

    krishmk Well-Known Member

    Messages:
    1,376
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    185
    #2
    You can probably try this

    <?php
    if (isset($_GET['u']) && empty($_SERVER['HTTP_REFERER']))
    {
    // display some message
    echo ("You are not permitted to view this page");
    // OR
    // redirect this visitor to your homepage or some other page
    header ("Location:http://mysite.com");
    }
    ?>
    PHP:
    Basically this code checks if the visitor came to this internal page directly (hotlinking from other sites etc.) and either displays an error message or redirects to your site's home page.


    P.S.: a) You must use only 1 (either the echo or header redirect) for this code to work
    b) Some browsers may just not send the referrer value. Hence this code is not 100% reliable..
     
    krishmk, Dec 5, 2009 IP
  3. lumpy

    lumpy Well-Known Member

    Messages:
    942
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    160
    #3
    Thanks, but that's not what I really need. I just need the header to be something that I want and the other page to be a web address. Just like in my example.
     
    lumpy, Dec 5, 2009 IP