1. Home
  2. Computing & Technology
  3. PHP / MySQL

Processing form data with PHP

By Angela Bradley, About.com

2 of 2

Processing the Form Data

Now lets create process.php to use the data from the HTML form we made:

<?php
print "Your name is ". $Name;
print "<br />";
print "You are ". $Age . " years old";
print "<br />";
$old = 25 + $Age;
print "In 25 years you will be " . $old . " years old";
?>

As you may be aware, if you leave out the method="post" part of the form, the URL with show the data. For example if your name is Bill Jones and you are 35 years old, our process.php page will display as http://yoursite.com/process.php?Name=Bill+Jones&Age=35 If you want, you can manually change the URL in this way and the output will change accordingly.

Index: Processing form data with PHP

  1. Using a Form to Collect Data
  2. Processing the Form Data

2 of 2

Explore PHP / MySQL

More from About.com

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Learn PHP
  5. PHP Form - PHP Form Tutorial - PHP Form Script

©2008 About.com, a part of The New York Times Company.

All rights reserved.