Have a question about a new index page

Discussion in 'HTML & Website Design' started by iowadawg, Jun 28, 2006.

  1. #1
    Right now, I have an index.php that naturally comes up when people visit the site.
    But I want to have them go to a new index page where if they agree to the terms, then they go to the index.php page.

    How can I do this?

    Here is the site in case it helps:
    http://www.freeadultdir.com

    Thank you.
     
    iowadawg, Jun 28, 2006 IP
  2. aaron_nimocks

    aaron_nimocks Im kind of a big deal Staff

    Messages:
    5,563
    Likes Received:
    627
    Best Answers:
    0
    Trophy Points:
    420
    #2
    Easiest way is change index.php to home.php and make index.php the page where they land and agree to the terms then go to home.php
     
    aaron_nimocks, Jun 28, 2006 IP
  3. iowadawg

    iowadawg Prominent Member

    Messages:
    10,918
    Likes Received:
    811
    Best Answers:
    0
    Trophy Points:
    380
    #3
    Sounds simple, but I know not where to go from there.

    How do I set up the new page?
    Any special code I need?
     
    iowadawg, Jun 28, 2006 IP
  4. brian394

    brian394 Well-Known Member

    Messages:
    226
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    108
    #4
    You could also do it simply by checking the request method of the page. If it's POST, you can assume that a person has submitted a form to arrive there (pressed an "I Agree" button for example), if it's GET then the person probably just typed the address in (or came from a search engine). Your code might look something like this...

    
    <?php
    
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
     // deliver normal page content here
    
    }
    else {
     // deliver warning message here...
     echo '<form name="form1" action="" method="[B]POST[/B]">' . "\r\n";
     echo 'Do you agree to the terms?' . '<br>' . "\r\n";
     echo '<input type="submit" value="I Agree">' . '<br>' . "\r\n";
     echo '</form>';
    
    }
    
    ?>
    
    Code (markup):
    You could also improve it further by adding a checkbox which the user must check, or having the user type in a series of letters (such as "I AGREE") to enter.
     
    brian394, Jul 1, 2006 IP
  5. TechnoGeek

    TechnoGeek Peon

    Messages:
    258
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hello, iowadawg.
    Normally, a server recognizes as the home page of your site one that has the name "index.html", or "index.php", or something similar. When someone types in his browser "http://www.yourbeautifulsite.com", then the server returns that page. You must make so that the page you want the user to see first has that magic name. From that page you may link to whatever other page you want. You can, for example, insert in your home page your conditions for the use of the site, and at bottom include a link saying something like "Click here if you agree." The target page will be the one that was formerly the home page.
     
    TechnoGeek, Jul 1, 2006 IP