Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions