1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Input field -> Page

Discussion in 'General Scripting Chat' started by thefallendevelopment, Sep 17, 2010.

  1. thefallendevelopment

    thefallendevelopment Junior Member

    Joined:
    Aug 19, 2008
    Messages:
    170
    Likes Received:
    161
    Occupation:
    Crankin out sites
    Location:
    In the Caddy Shack
    So i was wondering how i can achieve this and if any of you guys would know.

    So lets say i have a site, you have to input a certain number (that i assign) to get to that page.

    Any ideas?
     
  2. paincake

    paincake Power Member

    Joined:
    Aug 18, 2010
    Messages:
    716
    Likes Received:
    3,099
    Home Page:
    One way to do this:
    PHP:
    <form name="input" action="yourpage.php" method="get">
    Code: <input type="text" name="code" />
    <
    input type="submit" value="Submit" />
    </
    form>
    And then in the actual page that's displaying content you'd have
    PHP:
    <?php
      $code 
    $_GET["code"];
      if (isset(
    $code) && $code == "your_code"){
      
    //display content
    }
    ?>
    set your_code to whatever code you want.
    and then where it says //display content, you'd have a print or echo function with all the html
     
    • Thanks Thanks x 1
  3. thefallendevelopment

    thefallendevelopment Junior Member

    Joined:
    Aug 19, 2008
    Messages:
    170
    Likes Received:
    161
    Occupation:
    Crankin out sites
    Location:
    In the Caddy Shack
    Thank you so much!