We have 18 guests online
   
PHP Scripts arrow Free PHP Tutorials arrow Free PHP Tutorials arrow PHP Tutorials and Examples arrow PHP 
Free PHP Tutorials arrow PHP Tutorials and Examples arrow PHP

Simple form submission with PHP
User Rating: / 3
PoorBest 

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.

  1. <?php
  2.  
  3. if($_POST) { // checks to see if the $_POST superglobal is set, indicating that the form was submitted
  4.     // process the information...
  5.     // ...
  6.     // ...
  7.     echo "Your form was posted and processed!";
  8. } else { // the user has not submitted the form -- show the form
  9.  
  10. ?>
  11.  
  12.  
  13. <form action="<?=$_SERVER['REQUEST_URI']?>" method="post">
  14. ... ...
  15. <input type="submit" value="go">
  16. </form>
  17.  
  18. <?php
  19. }
  20. ?>

 

 

Directory Stats

There are 718 listing and 44 categories in our website

Change Language

Mobile Phones
Debt Consolidation
Christmas Gifts
Free Image Gallery
Directory