1) Create a form that asks a user for his/her name and some comments. Then create two PHP scripts that create a response. The first script displays the information which the user has submitted ("Hello $name. These are your comments: $comments") and asks the user whether he/she really wants to submit the information. The second script is invoked by the first one and displays "Thank you $name. Your comments have been submitted: $comments". Form:
----------------------------------------------------------------- First PHP Script:Hello $name. Here are your comments:
$comments"; ?> ----------------------------------------------------------------- 3) Use PHP session handling functions for the previous exercise First PHP file:
$comments
"; ?> Click here to submit them. ----------------------------------------------------------------- Second PHP file:
$comments"; ?> ----------------------------------------------------------------- 4) Hit counter: create a file that contains only the number "0". Your PHP script must open that file for reading; read the first line of the file into a scalar variable; increase the number by one; close the file; open the file again for writing (not appending); write the number to the file; close the file. Because of permissions, first, you need to create and save the file manually. Then you need to change the file permissions to 666 on the command-line.