1 replies
  • WEB DESIGN
  • |
I have a Christmas site where I want to do one of those fill in the blank "Santa letters" and use the inputs to show a personalized letter from that data.( on the site only) I am guessing is is simple to do but how do I go about it?

When I have them hit the submit button, am a really just going to another page? And how to I get the imputed date to show up on the new page?

Am I even going in the right direction?
#data #letter #santa
  • Profile picture of the author Brandon Tanner
    Pretty simple task with a little bit of PHP. First, on the main page, you'll need a form with inputs and a submit button. For example, lets say you want to get the user's first and last name, and pass it to another page...

    <form action="otherpage.php" method="POST">
    <input type="text" name="FirstName">
    <input type="text" name="LastName">
    <input type="submit" value="Submit">
    </form>


    FYI - the text inputs don't have to be right next to eachother... you can put as much text as you want in between each input... the above code is just a quick example.

    Then, you'll need to create a PHP page that's the same name as what's in the "form action" above (ie otherpage.php) and paste the following code at the top of the page...

    <?php
    $FirstName = $_POST['FirstName'];
    $LastName = $_POST['LastName'];
    ?>

    Then wherever you want the first name to appear on the page (in the regular HTML part), you would do this...

    <?php echo $FirstName; ?>

    And the last name...

    <?php echo $LastName; ?>

    Etc etc.

    Make sense?
    Signature

    {{ DiscussionBoard.errors[7173356].message }}

Trending Topics