Question: With your Guestbook visible in your browser, type your name, email address and some comments in the associated text fields. Click the [ submit ]

With your Guestbook visible in your browser, type your name, email address and some comments in the associated text fields. Click the [ submit ] button. Return to your server location that is storing your files in the MyData folder. Notice that your data that you just entered is stored in the comments.txt text file.

if (isset($_POST['submit'])) {

$filename = "comments.txt";

$fp = fopen($filename, "a");

$myName = $_POST["txtName"] . " ";

$myEmail = $_POST["txtEmail"] . " ";

$myComments = $_POST["txtComments"] . " ";

//set the time stamp

$date = date("l, F j, Y") . " ";

$time = date("h:i A") . " ";

fwrite($fp, $date);

fwrite($fp, $time);

fwrite($fp, $myName);

fwrite($fp, $myEmail);

fwrite($fp, $myComments);

fclose($fp);

$url = "summary.php";

header("Location: $url");

}

?>

Guestbook

GuestBook

Name



Email



Comments



Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!