PDA

View Full Version : Form Help



sBosma
18-03-2007, 09:22 PM
The form I made is working, but the email it sends me is blank. The actual form is working, but the mailconfig.php must have something wrong with it. I get an email with the correct subject and 'from email' but the actual email is blank.

Heres the code for mailconfig.php:

<?
$name = $_REQUEST['realname'] ;
$habboname = $_REQUEST['habboname'] ;
$email = $_REQUEST['email'] ;
$hotel = $_REQUEST['hotel'] ;
$job = $_REQUEST['job'] ;
$experience = $_REQUEST['experience'] ;

mail( "MY EMAIL", "Job Application",
$message, "From: $email" );
header( "Location: confirmation.htm" );
?>

This is my first time making a form, so I have NO idea what is wrong. Please help by posting the problem and/or posting the working mailconfig.php code.

Thanks,

sBosma

Drompo
19-03-2007, 01:18 PM
<?php
if(!$email == "" && (!strstr($email,"@") || !strstr($email,".")))
{
die ("Invalid Email Address");
}
if(empty($name) || empty($habboname) || empty($email) || empty($hotel) || empty($job) || empty($experience) ) {
die ("You didn't fill in all the fields");
}

$subject = Job Application;

$message = "Name: $name \n
Habbo Name: $habboname \n
Email: $email \n
Hotel: $hotel \n
Job: $job \n
Experience: $experience";

$from = "From: [email protected]\r\n";


mail("YOUR EMAIL", $subject, $message, $from);
echo "Thank you for your application"

?>

Edit YOUR EMAIL to your email address and edit

$from = "From: [email protected]\r\n";

to which email address you want it to come from.

Invent
19-03-2007, 05:43 PM
<?php
if(!$email == "" && (!strstr($email,"@") || !strstr($email,".")))
{
die ("Invalid Email Address");
}
if(empty($name) || empty($habboname) || empty($email) || empty($hotel) || empty($job) || empty($experience) ) {
die ("You didn't fill in all the fields");
}

$subject = Job Application;

$message = "Name: $name \n
Habbo Name: $habboname \n
Email: $email \n
Hotel: $hotel \n
Job: $job \n
Experience: $experience";

$from = "From: [email protected]\r\n";


mail("YOUR EMAIL", $subject, $message, $from);
echo "Thank you for your application"

?>

Wth?
$message = "Name: $name \n
Habbo Name: $habboname \n
Email: $email \n
Hotel: $hotel \n
Job: $job \n
Experience: $experience";

You havn't defined ANY of those variables?

sBosma
19-03-2007, 11:49 PM
I got a form working. Thanks to any one who helped though.

Frog!
21-03-2007, 10:56 AM
Wth?

You havn't defined ANY of those variables?
I think he was going off the Variables that were in the 1st post.

Want to hide these adverts? Register an account for free!