Hi
Everybody,
I want to use a php form to save the data inputted to it ,within the hosting server as simple text file. As most of the hosting services don't provide mailing PHP and even if so then the mail address must of the of the same domain for which the hosting server is being used. So i wondering is there any way to save the information instead of sending via email. Kindly Please help me.
The Form Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"
http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Your Informations</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="mailer.php" method="post">
Your Name: <input type="text" name="test">
Your Email: <input type="text" name="email">
Your Message:
<textarea name="message" rows="5" cols="30"></textarea>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
The PHP code for the form
<?PHP
$to = "
[email protected]";
$subject = "Results from your Request Info form";
$headers = "From: Form Mailer";
$forward = 1;
$location = "
http://XXXXXXXX.com";
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you for submitting our form. We will get back to you as soon as possible.";
}
?>
Above form and PHP script work fine for servers providing an email PHP script. But most of the free hosting services are not providing it anymore. So it will also work for me if i could make an arrangement to save the inputs of the form..
What Minimal Modification in the script can serve the Purpose Thanks.....