TOP TECH
  Learn How to.....
Welcome IT Related Articles Member Area  |  Sign In  |  Sign Up
.: Home :.
General
HTML
CSS
PHP
PHP-MySQL
FrontPage
Photoshop
CorelDRAW
PageMaker
MS Office
VisualBasic
All
.

.: Home :.

Home >> General
Creasting Dynamic Web Sites 3.2 [Page 1]
Article by: Shelton Manage
Sunday, 14th June, 2009


Handling HTML Forms with PHP Redux

To ahave one page both display and handle a form, use a conditional.

if (/* form has been submited */) {
// Handle it.
} else {
// Display it.
}

To determine if the form has been submitted, I normally check if the $submit vriable is set (which is the name of the submit input type in the form).

if ( isset($_POST['submit'])) {
// Handle it.
} else {
// Display it.
echo '';
}

If you want a page to handle a form and then display it again use.

if (isset($_POST['submit'])) {
// Handle it.
}
// Display it.

this page both displays and handles a registration form.

register.phps | register.php



Page: First - 1 2 3 4 5 - Last

 



Comments


© 2009 Top Sri Lanka Top Tech.
Articles Manager β - Script by: DynamicCodes.com