Need Help with adding something.. Not to sure?

Discussion in 'HTML & Website Design' started by MMD, Jun 22, 2009.

  1. #1
    Hey,

    I want to add something that would like cover the page the person visiting but once they completed something they may move onto the page.

    Such as to download this content you must first enter your name here.. Once the name is entered the person is then allowed to recieve the content..


    Anyone know?

    Would be Big Big help

    Thanks!

    Mike
     
    MMD, Jun 22, 2009 IP
  2. Louis11

    Louis11 Active Member

    Messages:
    783
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    70
    #2
    You could theoretically do this with Javascript, however it can be disabled pretty easily. Your best bet would be a PHP solution with a MySQL backend.

    Setup a basic form, something like:
    
    <form action="gather_names" method="post">
    Enter your name to access this page, and download the files! <br />
    <input type="text" name="username" size="20" />
    <input type="submit" name="submit" value="Submit" />
    </form>
    
    Code (markup):
    Once that is done, setup a PHP page, something like:
    
    <?
    session_start();
    
    if(isset($_SESSION['entered_name']) && $_SESSION['entered_name'] == true)
    {
    ?>
    
    PUT YOUR HTML CONTENT HERE
    
    <?
    }
    
    else
    {
    // Show the HTML form / Process the POST request and set the session
    }
    ?>
    
    PHP:
    Hope that helps :)
     
    Louis11, Jun 22, 2009 IP