Jump to content

Form data


dunn_cann

Recommended Posts

I used the following html to construct the form:
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>Feedback Form</title>
</head>
<body>
<u>Please complete this form to submit your feedback:</u> <br />

<form action="handle_form.php" method="POST">

Mr. <input type="radio" name="title" value="Mr." />
Mrs. <input type="radio" name="title" value="Mrs." />
Ms. <input type="radio" name="title" value="Ms." />
<br />
Name: <input type="text" name="name" size="20" />
<br />
Email Address: <input type="text" name="email" size="20" />
<br />
Response: <select name="response">
<option value="excellent">This is excellent.</option>
<option value="okay">This is okay.</option>
<option value="boring">This is boring.</option>
</select>
<br />
Comments: <textarea name="comments" rows="3" cols="30"></textarea>
<br />
<input type="submit" name="submit" value="Send My Feedback" />

</form>

<!-- Feedback.html -->
</body>
</html>

And i constructed the PHP Script as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>Practice Page</title>
</head>
<body>
<?php // handle_form.php

ini_set ('display_errors',1); // Let me learn from my mistakes.

// This page receives the data from feedback.html.
// It will receive: title, name, email, response, comments, and submit.

print "Thank you {$_POST['title']} {$_POST['name']} for your comments. <br />";
print "You stated that you found this example to be {$_POST['response']} and added: {$_POST['comments']}";
?>
</body>
</html>
[/code]
Could someone tell me how i might include an address/url into the php script so as i could then be able to send the received data onto a colleague for example. Thanks for any and all help.
Link to comment
https://forums.phpfreaks.com/topic/33021-form-data/#findComment-153800
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.