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
developerWorks - FREE Tools! |
Building a software-as-a-service solution requires addressing a few key technical challenges. In this webcast, we'll focus on the role of IBM Tivoli Directory Server and WebSphere Portlet Factory in creating a Software as a Service solution. We will demonstrate how to use Tivoli Directory Server to prevent the user population of one tenant from accessing the virtual portal and portlet components of another tenant. We will also use the dynamic profile capability of WebSphere Portlet Factory to create multiple highly customized applications from one code base. FREE! Go There Now!
|
|
|
|
Learn to enable users to both rate existing animations and to combine existing animations into new snippets. This is the third in a series of three tutorials that chronicle the building of a site that enables collaborative discussion and animation building using Domino and OpenLaszlo. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download a free trial version of Lotus Quickr 8.0, which enables collaboration by transforming the way everyday business content such as documents, rich media, photos, and video can be shared. Lotus Quickr makes it faster and easier to share content of all types (not just documents) within virtual teams. It is designed to make it easier to collaborate across organizational boundaries, while continuing to work within the context of familiar desktop applications. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download IBM DB2 Express-C 9.5, a no-charge version of DB2 Express 9 database server. DB2 Express-C offers the same core data server base features as other DB2 Express editions and provides a solid base to build and deploy applications developed using C/C++, Java, .NET, PHP, and other programming languages. FREE! Go There Now!
|
|
|
|
Download a free trial version of IBM Rational Developer for System z, software that can help you deliver core development capabilities; the power of Java Platform, Enterprise Edition (Java EE); and rapid application development support to diverse enterprise application development teams. With comprehensive development tools to help create, deploy and maintain traditional enterprise and composite applications, Rational Developer for System z enables developers with different technical backgrounds to easily participate in important technology projects. FREE! Go There Now!
|
|
|
|
Join this Rational Talks to You teleconference on December 6 at 1:00 pm ET to participate in an agile application development discussion and get your questions answered on using IBM Rational Method Composer in a distributed environment.Get your questions answered! FREE! Go There Now!
|
|
|
|
Learn the basics of the IBM Customer Information Control System (CICS). With a hands-on exercise, learn how to get your first CICS application up and running on your desktop using TXSeries V6.1 for Windows. The tutorial shows you how to download and install a free trial version of TXSeries V6.1. FREE! Go There Now!
|
|
|
|
Get a free trial download of the latest version of IBM Rational Performance Tester V7.0.1, a load and performance testing solution for teams concerned about the scalability of their Web-based applications. Combining multiple ease-of-use features with granular detail, Rational Performance Tester simplifies the test-creation, load-generation and data-collection processes that help teams ensure the ability of their applications to accommodate required user loads. FREE! Go There Now!
|
|
|
|
The discipline of assembling and delivering software is maturing beyond standard developer-centric compile/test software builds. The end-to-end software development lifecycle is emerging as the new focus moves “Beyond the Build.” Join this on demand webcast to learn about methods for streamlining software delivery and key capabilities of the IBM Rational Build Forge framework for automating build and release management in environments of any size. FREE! Go There Now!
|
|
|
|
Join this webcast to learn how IBM Rational's Functional Testing solution enables you to implement automation your way, at your pace, with your existing staff. In this webcast, you’ll learn how you can eliminate redundancy of manual test scripts, reduce errors, and increase test coverage through test automation. After this presentation you will understand how IBM Rational Functional Testing solution can streamline your manual testing and make test automation easily attainable. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |