PDA

View Full Version : Submit Form



tsvehla1220
01-31-2006, 08:36 PM
I currently figured out my problem on my page and fixed it. BUT now i need to make sure my user can hit the submit button and it e-mails me the information and sends them to another page.

What do i need to change in my coding to do this?

http://www.****wallstreet.com/test/Buy.html is the page

The thing is when you go to http://www.****wallstreet.com/test/

you click any spot on the grid and it inputs and goes to the http://www.****wallstreet.com/test/Buy.html page. Then the properties appear in the X and Y section.

I want it so that information is sent to my e-mail address and then it goes to lets say like whatever.html page ya know?

Im a little confused on what to do! any help would be great! Thanks Alot!

Twey
01-31-2006, 09:16 PM
You need a server-side language.

tsvehla1220
01-31-2006, 09:20 PM
what do you mean by a side server language or where do i get it at?

tsvehla1220
01-31-2006, 11:12 PM
Im trying to figure out a form to send to my e-mail after the user fills it out.

here's my mail.html file 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>Untitled Document</title>
</head>

<body>
<form action="mail.php" method="post">
Your Name: <input type="text" name="name"><br>
E-mail: <input type="text" name = "email"><br><br>
Comments<br>
<textarea name="comments"></textarea><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
=========================================

then my mail.php file is
=========================================
<!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>Untitled Document</title>
</head>
<?
function checkOK($field)
{
if (eregi("\r",$field) || eregi("\n",$field)){
die("Invalid Input!");
}
}

$name=$_POST['name'];
checkOK($name);
$email=$_POST['email'];
checkOK($email);
$comments=$_POST['comments'];
checkOK($comments);
$to="php@gowansnet.com";
$message="$name just filled in your comments form. They said:\n$comments\n\nTheir e-mail address was: $email";
if(mail($to,"Comments From Your Site",$message,"From: $email\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>
<body>
</body>
</html>

======================================

Im trying to figure out why it doesnt work. Everytime i click the submit button a thing pops up asking me if i want to download the mail.php file.
Is there something wrong with this or what do i need to change?