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! |
WebSphere Process Server delivers a unique integration framework that simplifies existing IT resources. Often, as IT assets grow to support business demand, so too does their complexity and manageability. In this webcast, we’ll discuss how WebSphere Process Server helps deliver an SOA infrastructure that provides a common model to orchestrate, mediate, connect, map, and execute the underlying IT functions. Discover how WebSphere Process Server simplifies integration of business processes by leveraging existing IT assets as reusable services without the complexities of traditional integration methodologies. 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!
|
|
|
|
Listen to this webcast to get an overview of Info 2.0 and a technical demo of how to quickly build an enterprise mashup. IBM's Info 2.0 technology leverages emerging Web 2.0 technologies such as mashups, feeds, AJAX, and JSON in order to simplify assembly of information using feeds and services. Come learn about the technical elements of Info 2.0 including the Feed Generation framework, Mashup Engine, and mashup assembly components. Learn how to pull information from databases, departmental information, and the Web to create mashups critical to your company’s success. We will also discuss best practices to help you get started. 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!
|
|
|
|
Join this webcast to discover the key requirements for successful change and release management. Learn how to extend your .NET environment to improve productivity and collaboration, and address core problems afflicting team development. In this webcast, we’ll review typical challenges faced by customers and how to resolve them with the IBM Rational Change and Release Management solution, including Rational ClearCase, Rational ClearQuest and Rational Build Forge. Replay is available for 9 months. FREE! Go There Now!
|
|
|
|
You can now evaluate IBM Rational Asset Manager V7.0 online without installing or configuring it on your own system! Rational Asset Manager helps create, modify, govern, find, and reuse any type of development assets, including SOA and systems development assets. Rational Asset Manager helps you reduce software development costs and improve quality by facilitating the reuse of all types of software development-related assets. Visit developerWorks to learn more about this product and register to explore its capabilities online. FREE! Go There Now!
|
|
|
|
Whether you are creating new applications or modifying existing ones, managing integration of new components with traditional z/OS elements is a critical part of building and deploying modern applications. Listen to this webcast to see how IBM can help you optimize your development process using an IDE like Rational Developer for System z that integrates with management tools, such as ClearCase to manage your application development on mainframes. FREE! Go There Now!
|
|
|
|
Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, where he will overview Rational’s new offerings and programs to help customers accelerate software innovation on System z. He will discuss how these solutions help organizations extend their core business processes toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time. FREE! Go There Now!
|
|
|
|
Viper 2 brings a great value to developer communities including SQL, XML, PHP, Ruby, .NET and Java. You probably already know that DB2 Express-C is free for developers to develop, deploy and distribute. Viper 2 provides a variety of means that help move your application from the development stage to deployment more rapidly. This webcast shows how to best utilize the latest tools available for developing DB2 applications. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |