Click to See Complete Forum and Search --> : Form Action


Jonathan
07-07-2003, 01:36 AM
Ok, when I e-mail a form from my site, it comes to my e-mail in-box... BUT it has no writing... how come?!

Here are the files...

Feedback.html
www.crosspoint.org/Feedback.html

Feedback.php
www.crosspoint.org/feedback.php

Registration.htm
www.crosspoint.org/registration.htm

Registration.php
www.crosspoint.org/registration.php

Please help me!

pyro
07-07-2003, 07:54 AM
I tried filling out the feedback form, and from what I could see, it worked fine. Did you get it and was the text filled out?

Jonathan
07-07-2003, 12:40 PM
No, it was just a blank e-mail...

But when [J]ona gave me his script it worked just fine... whats up?

pyro
07-07-2003, 12:42 PM
Post the PHP code you are using. The code that I linked to ( http://forums.webdeveloper.com/showthread.php?s=&threadid=9543#post48748 ) works fine...

Jonathan
07-07-2003, 12:44 PM
This is for the Feedback, not the Registration... registration.php is almost the same thing

<?PHP

$subject = "Feedback";
$headers = "From: Form Mailer";
$forward = 1;
$location = "feedbackthankyou.html";
$addresses = array("webmaster@crosspoint.org","dvaughan@crosspoint.org","lhale@crosspoint.org");

$date = date ("l, F jS, Y");
$time = date ("h:i A");

$msg = "This form was submitted on $date at $time.\n\n";

foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}

foreach ($addresses as $email) {
mail($email, $subject, $message, $headers);
}
if ($forward == 1) {
header ("Location:$location");
}
else {
echo ("Thank you for submitting our form.");
}

?>

pyro
07-07-2003, 12:46 PM
This line:

mail($email, $subject, $message, $headers);

should be:

mail($email, $subject, $msg, $headers);

Jonathan
07-07-2003, 12:52 PM
THANK YOU PYRO!

it works now

pyro
07-07-2003, 12:52 PM
You're welcome... :)

Jonathan
07-07-2003, 12:53 PM
wait, the registration does the same thing... hold on, I will post the script

<?PHP

$subject = "Registration";
$headers = "From: Form Mailer";
$forward = 1;
$location = "feedbackthankyou.html";
$addresses = array("webmaster@crosspoint.org","dvaughan@crosspoint.org","lhale@crosspoint.org");

$date = date ("l, F jS, Y");
$time = date ("h:i A");

$msg = "This form was submitted on $date at $time.\n\n";

foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}

foreach ($addresses as $email) {
mail($email, $subject, $msg, $headers);
}
if ($forward == 1) {
header ("Location:$location");
}
else {
echo ("Thank you for submitting our form.");
}

?>

Jonathan
07-07-2003, 12:55 PM
there ya go.. i have edited my post

pyro
07-07-2003, 12:57 PM
I would use the same script for both... No need to have separate form hanlers, really...

Jonathan
07-07-2003, 12:58 PM
ok, good point...

Jonathan
07-07-2003, 01:00 PM
Thanks again!

pyro
07-07-2003, 01:07 PM
:D You bet....