• 10Nov

    We can use forms to gather data from our users. Then we can parse the data and return something dynamic to the user! In this tutorial you will see how you can start a form and gather simple data.
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    What is a form
    How do I submit
    Trimming user data
    PHP and HTML intermingling
    You can find this tutorial video on youtube here.

    Here are the sources used in this tutorial:
    tut008.php
    <form action="?" method="post">
    
    Tires type <input type="text" name="first" value="<?php
    echo /*(int)*/$_REQUEST['first'];
    
    ?>" />
    How many <input type="text" name="second" value="<?php
    
    echo (int)$_REQUEST['second'];
    ?>" />
    
    <input type="submit" />
    </form><br />
    <?php
    
    echo 'Your cost will be $'.(((int)$_REQUEST['first']*20)*(int)$_REQUEST['second']);
    
    //echo trim($_REQUEST['first']);
    
    ?>

    Here are all the php functions used in this tutorial:

    Posted by Kloplop321 @ 5:16 pm

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.