4_FormValidation
4_FormValidation
Worksho
1) Make an HTML form as given below Set the textbox.Name
= “name” Save it as “form.html”
2) Type the code for the PHP script given on the next slide
Call the script from the HTML form DISCUSS
TASK # 47 – Validating Forms p
Worksho
TASK # 48 – Validating Forms Worksho
p
Hints :
TASK # 50 – $_SERVER['PHP_SELF'] p
1) Type the code Execute Discuss Worksho
2) What does “$_SERVER['PHP_SELF']“return ?
3) Do you notice anything in URL when the script is run ?
TASK # 51 – $_SERVER['PHP_SELF'] p
Worksho
1) Add the following statements on top of the previous script
2) Execute Discuss
TASK # 52 – A Number Guessing Game p
Worksho
1) Type the first part of the code DO not execute discuss
TASK # 52 – A Number Guessing Game p
1) Type the statements on top of the previous script. Worksho
2) Execute Discuss
TASK # 53 – Hidden Fields
Wo r ks h o p
1) Add some statements in the previous script at the following places
2) Execute DISCUSS
TASK # 54 – Redirecting User p
1) Add the following in the previous script at the following places Worksho
2) Make sure the file a user is being directed to exists.
3) Execute DISCUSS
http://www.example.com/test_form.php/%22%3E%3Cscript%3Ealert('hacked')%3C/script%3E