Question: Write an HTML document that includes an anchor tag that calls a PHP document. Also, write the called PHP script document, which returns a randomly

Write an HTML document that includes an anchor tag that calls a PHP document. Also, write the called PHP script document, which returns a randomly chosen greeting from a list of five different greetings. The greetings must be stored as constant strings in the script. A random number between 0 and 4 can be computed with these lines:
# Set the seed for mtrand with the number of microseconds
# since the last full second of the clock
mt_srand((double)microtime() * 1000000);
$number = mtrand(0, 4); # Computes a random integer 0-4

Write, test, and debug (if necessary) PHP scripts for the specifications that above.

Step by Step Solution

3.33 Rating (168 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

HTML document To test the scripts save the HTML fi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming World Wide Questions!