Re-direct to an error.html

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

  1. #1
    Members visiting out Club Web Site can enter their 'Member Number' into a textfield and the below PHP scrip re-directs them to their own member.html

    I want to know how I can re-direct them to an error.html if anything other than a member number or an incorrect number is entered.

    Any help please

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

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    does your memberId stored in a database? or its autogenerated?
     
    bartolay13, Oct 21, 2008 IP
  3. mringuk

    mringuk Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It's neither stored in a database nor is it autogenerated. All the members HTML pages are in a folder call 'member_files' and the PHP selects them. Is there a coding which can be added to say that if the member.html isn't there then goto error.html.
     
    mringuk, Oct 21, 2008 IP
  4. Kyosys

    Kyosys Peon

    Messages:
    226
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    look in your other thread, I gave you something which I think is what you want
     
    Kyosys, Oct 22, 2008 IP