Re-direct to error.html

Discussion in 'PHP' started by mringuk, Oct 21, 2008.

  1. #1
    Within my Club Site members can enter their Membership Number into a textfield and the below PHP re-directs them to their own Details Page.html.

    I want to be able to send others to an error.html if none membership numbers are entered.

    Any help please


    
    <?php
    
    $host  = 'http://www.mysite.co.uk/members_secure/';
    $uri   = 'member_files/';
    $memberID = $_REQUEST['member'];
    $extra = $memberID.'.html';
    
    header ("Location: $host$uri$extra");
    exit;
    ?>
    
    PHP:
     
    mringuk, Oct 21, 2008 IP
  2. Kyosys

    Kyosys Peon

    Messages:
    226
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if(!$_REQUEST['member']) header("Location: error.html");

    is that what you want?

    Also, there's no need to use exit if the script ends anyway
     
    Kyosys, Oct 21, 2008 IP