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! |
Achieving true agility is a never-ending effort. We will showcase how you can become agile incrementally, a few practices at the time.Which practices should any agile team strive to adopt? What additional practices should you consider based on your needs to scale? Adopting practices are however made much easier with the right tool support. What about if your tools adapt to your practices? We will take a look at how the Jazz technology can be leveraged to make your process change the behavior of your tools. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download a free trial of the latest release of IBM Lotus Sametime Standard V8.0. Lotus Sametime Standard V8.0 is a platform for unified communications and collaboration that combines security features with an extensible, open solution including integrated Voice over IP, geographic location awareness, mobile clients, and a robust Business Partner community offering telephony and video integration. FREE! Go There Now!
|
|
|
|
Join this webcast to see how IBM Data Studio Developer and pureQuery can take the pain out of Java data access. uApplications developed using both Java and SQL have become a common requirement. Database connectivity using Java Database Connectivity (JDBC) to create an application is a multi-step tedious process, and tooling that covers both SQL and Java has been unavailable, until now. IBM Data Studio introduces the pureQuery platform: a high-performance, Java data access platform focused on simplifying the tasks of developing, managing, and optimizing database applications and services. FREE! Go There Now!
|
|
|
|
In this tutorial, you can learn how to install and configure the IBM Rational Asset Manager Eclipse client, explore the different views in the Asset Management perspective, learn various search techniques, work with existing assets, and submit a new asset. FREE! Go There Now!
|
|
|
|
Manage, govern, and share services across your organization by using WebSphere Service Registry and Repository. Follow the hands-on exercises to learn how to navigate the Web interface to publish, find, reuse, and update services. FREE! Go There Now!
|
|
|
|
Rational Modeling Extension for Microsoft .NET enhances usability for code generation supporting a more intelligent refactoring. The latest enhancements enable organizations with Java and .NET systems and software development maintain architectural integrity across heterogeneous platforms. FREE! Go There Now!
|
|
|
|
Because access to government information continues to be an area of concern for many U.S. citizens with disabilities, the U.S. government enacted Section 508 of the Rehabilitation Act in 2001 to ensure that government agencies create accessible Web content, enabling all citizens to access the information they need. A fully accessible Web site makes Web content accessible to all individuals, including those with disabilities, who may be accessing Web content via a variety of user agents. Common user agents include standard Web browsers, text-only browsers, assistive devices and mobile devices such as cell phones or personal digital assistants (PDAs). FREE! Go There Now!
|
|
|
|
Informix Dynamic Server (IDS) Express Edition offers outstanding online transaction processing (OLTP) database performance, while helping to simplify and automate many of the tasks associated with deploying databases for small business applications. IDS 11 further extends the ease of management and applications integration with the Admin API and Scheduler, high availability with Continuous Log Restore for backup server recovery in case of a primary server failure, and column level encryption to protect personal and company private data. FREE! Go There Now!
|
|
|
|
Join this Rational Talks to You teleconference, to hear how Enterprise Generation Language (EGL) eliminates the need for tedious and error-prone low level coding, so developers can focus on business requirements. EGL extends the Rational software development platform with a simplified programming language that enables developers who have little or no experience with Java, Web technologies or Service Oriented Architecture, to create enterprise-class applications and services quickly and easily. It also allows developers who may have little or no mainframe programming experience to quickly create traditional mainframe components. FREE! Go There Now!
|
|
|
|
In this webcast, IBM Rational will discuss the importance of Web application security and will share techniques and best practices to introduce application security testing into current QA processes including: understanding common security vulnerabilities and techniques to integrate security testing with defect tracking and remediation systems in an effort to safeguard sensitive online information. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |