File Manipulation Code

  Home arrow File Manipulation Code arrow Form Examples Text Boxes to Drop Downs
FILE MANIPULATION CODE

Form Examples Text Boxes to Drop Downs
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 14
    2005-02-13

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    A lot of my time is spent wondering why some forms will work, and some won't.
    Mostly its a case of uppercase/lowercase errors, Such as "Name" and "name".
    I wrote this as a 'cheat' and keep it in my 'examples' folder so that I can snippet
    parts (cut'n'paste) as when I need them in my forms.


    By : kaelastreet

    <html>

    <head>
    <title>Form Examples by Kaela Street</title>
    </head>
    <body>


    <form name="form" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
    Form Examples by Kaela Street<br>
    Enter some text or numbers:
    <input name="TextData" type="text" value=""><br>

    Select one or more checkboxes:
    <input name="one" type="checkbox" value="Box one, ">One
    <input name="two" type="checkbox" value="Box two, ">two
    <input name="three" type="checkbox" value="Box three, ">three<br>

    Select <b>one</b> of the radio buttons:
    <input name="radio" type="radio" value="Mum" >Mum
    <input name="radio" type="radio" value="Dad" > Dad
    <input name="radio" type="radio" value="Kitty Cat" > Kitty Cat <BR>

    Replace the text in this box with your own text:
    <textarea name="boxy" rows=5 cols=20 wrap="off">Example Data
    </textarea><br>

    Now select <b>one</b> of the drop down choices:
    <select size="1" name="Name">
    <option value=""> </option>
    <option value="value1">Item1</option>
    <option value="value2">Item2</option>
    <option value="value3">Item3</option>
    <option value="value4">Item4</option>
    </select> <br>

    Now select<b> some </b> of the drop down choices:
    <select name="data[]" size="10" multiple >
    <option value="London">London</option>
    <option value="Manchester">Manchester</option>
    <option value="Glasgow">Glasgow</option>
    <option value="Winchester">Winchester</option>
    <option value="Oxford">Oxford</option>
    </select>


    <input type="submit" name="submit1" value="OK" >

    </form>
    <hr>


    <?php
    $TextData=$_POST["TextData"]; echo $TextData.'<br>';
    $box=$_POST["one"]; echo $box.' ';
    $box=$_POST["two"]; echo $box.' ';
    $box=$_POST["three"]; echo $box.' ';
    $radio=$_POST["radio"]; echo '<b>'.$radio.'</b> ';
    $boxy=$_POST["boxy"]; echo $boxy.' ';
    $Name=$_POST["Name"]; echo $Name.'<br>';

    $data = $_POST["data"];
    foreach ($data as $value)
    {
    echo $value."<br>";
    }
    ?>
    </body>

    </html>
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More File Manipulation Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    FILE MANIPULATION CODE ARTICLES

    - Bandwidth Control with pure PHP
    - Eazy Gallery
    - file_get_contents for PHP < 4.3.0
    - PHP Class: Image Snapshot 1.3
    - Universal downloader
    - Image Gallery v2.0
    - Free/Used Disk Space
    - Directory Lister
    - Directory image view, with selective hidden
    - Move or Copy a Directory (and files and sub ...
    - Ensure_Sub_Directory_Exists
    - Wedit
    - Form Examples Text Boxes to Drop Downs
    - myFiles
    - List files in a directory, no subdirectories


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap