Full-service Internet Marketing & Web Development
Recent Posts

Sponsors
![]() |
Simple form submission with PHPCode Wizard, 12-30-2006 |
This is a script that demonstrates simple form handling in PHP. The script prints a form to the browser that submits to itself. The script checks to see that the "posted" variable was set by the form (meaning the form has been submitted), processes the form information, and prints out a message indicating that the submission was successful.
<?php
if($_POST['posted'] == "1") { // checks to see if $_POST['posted'] was set (i.e. the form was submitted)
// process the information...
// ...
// ...
echo "Your form was posted and processed!";
} else { // the user has not submitted the form -- show the form
?>
<form action="<?=$_SERVER['REQUEST_URI']?>" method="post">
<input type="hidden" name="posted" value="1">
... ...
<input type="submit" value="go">
</form>
<?
}
?>
|
|
Subscribe Now to receive new posts via Email as soon as they come out.
Comments
Post your comments

