Miscellaneous
  Home arrow Miscellaneous arrow Page 3 - Working with forms in PHP
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS

Working with forms in PHP
By: Matt Wade
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 6
    2002-06-30

    Table of Contents:
  • Working with forms in PHP
  • A simple form
  • Text Boxes
  • Checkboxes
  • Radio Buttons
  • Textareas
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Working with forms in PHP - Text Boxes


    (Page 3 of 7 )

    Now, we will add another element to our form - a textbox. In form.html, after the line:

    <FORM method="POST" action="form.php">

    add the line:

    Fill in the text box: <INPUT type="text" name="mytextbox" size="20"><BR>

    This will add a text box called "mytextbox" that is 20 characters long to our simple form. Now, let's do something with the data that is entered in the textbox in out form.php script. After this line in form.php:

    echo "Great! You clicked the button!\n";

    add this line:

    echo "<BR>You typed <b>" . $_POST['mytextbox'] . "</b> in the textbox.\n";

    Now, go ahead and try it out again. As you can see, we have passed the data in the textbox from the first page to the next. It really is that simple. This is basically how it is going to work for each of the other form elements. There are a few subtle differences, but we will go through those.

    More Miscellaneous Articles
    More By Matt Wade


       · afafas;hiiu
       · You didn't over complicate a rather simple subject.Taught me everything I...
       · 
       · Hi, wz wonderin how i would submit the foreach() loop used for checkboxes to an...
       · Hope this works
       · Hi, I don't know if anyone responded to the first comment titled "how to...
       · If you don't check one of the 3 checkboxes in the form the foreach code generates an...
       · Easy to understand.Thanks for taking the time to share your knowlege.
       · Woohoo! I fixed the "error!"Instead of posting the code after...
       · Thanks for spending the time making this tutorial. It has assisted me...
       · This is great...
       · This is great...
       · 
       · the code: "if(isset($_POST['mycheckbox'])) { echo...
       · I'm new to this, so what do you mean by like a file, where do i save it, and its...
       · A great starter, clear and concise. Enough information to get a newbie like me...
     

    MISCELLANEOUS ARTICLES

    - Using PHP to Stream MP3 Files and Prevent Il...
    - 10 Must Have Firefox Improvements
    - All About OpenOffice 3.0
    - Shell Script Writing
    - Loops in the UNIX Shell
    - The Test in the UNIX Shell
    - Data Streams and the UNIX Shell
    - Control Mechanisms of the UNIX Shell
    - Variables Within the UNIX Shell
    - The Shell and UNIX
    - In Detail: UNIX File Systems
    - Rights Management in UNIX
    - UNIX File Systems
    - The Terminal in UNIX
    - Operating Systems and UNIX





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    Stay green...Green IT