Hi, I’m not experienced in any scripting language, but I read a little about PHP and followed a tutorial. I’m trying to send the email results of form data to my email account, and I got an error message when I tested it out.
My PHP page is
[code=php]<?php
$myemail = “[email protected]”;
$yourname = check_input ($_POST[‘yourname’]);
$email = check_input ($_POST[’email;]);
$submission = check input ($_POST[‘submission’]);
$site = check_input ($_POST[‘site’]);
$message = “Hello,
A submisison has been made by
Name: $yourname
E-mail: $email
URL: $site
Submission:
$submission
End of message
“;
mail ($myemail, $subject, $message);
header(‘Location: thanks.htm’);
exit();
function check_input ($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
?>
My HTML page is
[code=html]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” lang=”en” xml:lang=”en”>
<head>
<meta http-equiv=”Content-type” content=”text/html; charset=ISO-8859-1″ />
<link type=”text/css” rel=”stylesheet” href=”../index.css” />
<title> </title>
</head>
<body>
<form action=”submission.php” method “post”>
<p> Your Name: <input type=”text” name=”yourname” /> <br />
<p> Email: <input type=”text” name=”email” /> <br />
<p> Your Submission: <br />
<textarea name=”submission” rows=”30″ cols=”70″> </textarea> </p>
<p> Your website or blog: <input type=”text” name=”site” /> <br />
<p> <input type=”submit” value=”Submit!”> </p>
</form>
</div>
</body>
</html>
Since I pretty much just followed a tutorial and changed things, I’m sure I screwed a few things up. If anyone could help me out, I’d greatly appreciate it. Sorry for all the code, but I don’t really know what I’m doing. Thanks in advance.