Form Problems

Hello-

How do you create a form in PHP where the results entered in from the user will be generated in a table?
When I test the pages, I only get the start of the table, key and results(values) fields but no values! Here is my code:

Order form-
[php]

Order Page

Order Page

<?php foreach ($_POST as $key => $entry) { $totalfields++; echo "\n"; echo "" . $key . ""; if(is_array ($entry)) { $count = count($entry); echo ""; for ($i=0; $i<$count; $i++) { echo $entry[$i] . "
"; } echo ""; } else { echo "$entry"; } echo "\n"; } ?> First Name:

    <label for="lname">Last Name:</label>
    <input type="text" name="lname" id="lname"/><br/>
    <br/>
    
    <label for="residence">Address:</label>
    <input type="text" name="residence" id="residence"/><br/>
    <br/>
    
    <label for="Citie">City:</label>
    <input type="text" name="citie" id="citie"/>
    <br/>
    <br/>
    
    <label for="state">State:</label>
      <select name= "state" id="state">
        <option>Washington</option>
        <option>Oregon</option>
        <option>California</option>
        <option>Idaho</option>
        <option>Nevada</option>
       </select>
    <br/>
    <br/>
        
    <label for="zip">Zip:</label>
    <input type="text" name="zip" id="zip"/>
    <br/>
    <br/>
    
    <label for="products">Product 1:</label>
    <input type="checkbox" name="product_1" id="products"/><br/>
    
    <label for="products">Product 2:</label>
    <input type="checkbox" name="product_2" id="products"/><br/>
    
    <label for="products">Product 3:</label>
    <input type="checkbox" name="product_3" id="products"/><br/>
    
    <label for="products">Product 4:</label>
    <input type="checkbox" name="product_4" id="products"/><br/>
    <br/>

    <p><input type="submit" value="Submit"/></p>
[/php]

Results form-
[php]

Results form
Field Results
[/php]

lots of tutorials out there on MySQL select queries.

Sponsor our Newsletter | Privacy Policy | Terms of Service