PHP Forms PHP 05

1,523 views
1,451 views

Published on

PHP course lecture 5
PHP Forms
$_POST.
$_GET.

Published in: Education, Technology
1 Comment
7 Likes
Statistics
Notes
  • http://www.dbmanagement.info/Tutorials/MYSQL-PHP.htm
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
1,523
On SlideShare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
91
Comments
1
Likes
7
Embeds 0
No embeds

No notes for slide

PHP Forms PHP 05

  1. 1. PHP Course 5: PHP Forms PHP Course Info@ITBigDig.com
  2. 2. Instructor  Name: Mohamed Saad.  Email: Engsaad_aly@hotmail.com  Occupation: Web Developer In IT Big Dig. PHP Course Info@ITBigDig.com
  3. 3. Contents • PHP Forms o $_POST. o $_GET. PHP Course Info@ITBigDig.com
  4. 4. $_POST variable • The predefined $_POST variable is used to collect values from a form sent with method="post". • The variables are not displayed in the URL.
  5. 5. <!DOCTYPE html> <html> <body> <form action="redirect.php" method="post"> Username: <input type="text" name="username" autofocus> <br> Password: <input type="password" name="password"> <br> <input type="submit"> </form> </body> </html> Copy Code form.php PHP Course Info@ITBigDig.com Username: <?php echo $_POST["username"]; ?> <br /> Password: <?php echo $_POST["password"]; ?> Copy Code redirect.php
  6. 6. $_GET variable • Information sent from a form with the GET method is visible to everyone (it will be displayed in the browser's address bar) and has limits on the amount of information to send. • Note: The get method is not suitable for very large variable values. It should not be used with values exceeding 2000 characters.
  7. 7. <!DOCTYPE html> <html> <body> <form action="redirect.php" method=“get"> Username: <input type="text" name="username" autofocus> <br> Password: <input type="password" name="password"> <br> <input type="submit"> </form> </body> </html> Copy Code form.php PHP Course Info@ITBigDig.com Username: <?php echo $_GET["username"]; ?> <br /> Password: <?php echo $_GET["password"]; ?> Copy Code redirect.php
  8. 8. Write Your own PHP function
  9. 9. We hope You enjoy This Tutorial. For any Suggestions Please Email Us Info@ITBigDig.com PHP Course Info@ITBigDig.com End POST & GET

×