Friday 19 April 2013

PHP Form


PHP Form.
The most important part of the HTML form is current PHP script to get the data from the form and automatically HTML form that has been able to connect to a PHP file to get the data fed from the HTML form.

EXAMPLE:
<html>
The source code is action="user.php" method="post">
Name: <input type="text" name="nama" />
Age: <input type="text" name="umur" />
</ form>
</ html>

user.php file
<? php
echo 'Your name:'. $ _POST ['Name']. '<br />';
echo 'Your age:'. $ _POST ['Age']. 'years';
?>

RESULTS:
If you enter 'Budi' on the field name and '20 'on the life of the field will be printed.
Your name: Budi
Your Age: 20 years

No comments:

Post a Comment