PHP Tutorial Remarks



My Notes on using the w3schools PHP Tutorial

  1. Easy Learning with "PHP Tryit"
  2. PHP Introduction | w3schools
  3. PHP Installation | w3schools
  4. PHP Syntax | w3schools | Go to Top
  5. PHP Comments | w3schools | Go to Top
  6. PHP Variables | w3schools | php.net | Go to Top
  7. PHP Variables Scope | w3schools | php.net | Go to Top
  8. PHP echo and print | w3schools | php.net: echo and print | Go to Top
  9. PHP Data Types | w3schools | php.net | Go to Top
  10. PHP Strings | w3schools | php.net | Go to Top
  11. PHP Numbers | w3schools | Go to Top
  12. PHP Math | w3schools | Go to Top
  13. reserve

My Notes on using the w3schools PHP Tutorial for - PHP Form Handling

PHP - A Simple HTML Form that uses the POST Method


(html)
(body)

(form action="welcome.php" method="post")
Name: (input type="text" name="name")(br)
E-mail: (input type="text" name="email")(br)
(input type="submit")
(/form)

(/body)
(/html) 

About "welcome.php"


(html)
(body)

Welcome (?php echo $_POST["name"]; ?)(br)
Your email address is: (?php echo $_POST("email"); ?)

(/body)
(/html) 

welcome.php's output


Welcome John
Your email address is john.doe@example.com 

PHP - A Simple HTML Form that uses the GET Method


(html)
(body)

(form action="welcome_get.php" method="get")
Name: (input type="text" name="name")(br)
E-mail: (input type="text" name="email")(br)
(input type="submit")
(/form)

(/body)
(/html) 

About "welcome_get.php"


(html)
(body)

Welcome (?php echo $_GET["name"]; ?)(br)
Your email address is: (?php echo $_GET("email"); ?)

(/body)
(/html) 

These examples Lacked Security Safe-Guards

PHP Form Handling - GET vs. POST


PHP Form Validation

PHP Form Validation

forms-0001 - a form with a few different fields forms-0002 - a table representing the validation rules

Text Fields

forms-0003 - describes 4 fields

Radio Buttons

forms-0004 - describes 3 radio buttons

The Form Element

forms-0005 - describes the Form Element

What is the $_SERVER["PHP_SELF"] variable?

What is the htmlspecialchars() function?

Big Note on PHP Form Security

How To Avoid $_SERVER["PHP_SELF"] Exploits?

Validate Form Data With PHP

forms-0006 - example Validate Form

PHP Form Required

PHP - Required Fields

forms-0002 - a table representing the validation rules forms-0007 - code for required fields - 1
forms-0008 - code for required fields - 2

PHP - Display The Error Messages

forms-0009 - code for error messages

PHP Form URL/E-mail

PHP - Validate Name

forms-0010 - code for Validate

PHP - Validate E-mail

forms-0011 - looking for well formed email address

PHP - Validate URL

forms-0012 - looking for URL address

PHP - Validate Name, E-mail, and URL

forms-0013 - Validate Name, E-mail, and URL - 1
forms-0014 - Validate Name, E-mail, and URL - 2

PHP Form Complete

PHP - Keep The Values in The Form

forms-0015 - PHP script inside the value attribute

PHP - Complete Form Example

forms-0016 - PHP Form Validation Example forms-0017 - Code to complete - 1
forms-0018 - Code to complete - 2
forms-0017 - Code to complete - 3

Fini



Reserve