/    Sign up×
Community /Pin to ProfileBookmark

problem sending form to email

hello, ive just been over at the Javascript forum and found a solution to the javascript section of a form im working with. Now i think there could be a problem with the php. The form validates and fetches /contact.php but the thankyou page doesnt load and i receive no email.

Thanks for any help.

The Javascript post:
[URL=http://]http://www.webdeveloper.com/forum/newreply.php?do=newreply&noquote=1&p=667261[/URL]

The php form:

[CODE]
<?
$mailto = “[email protected]” ; // webdeveloper.com example email address

$subject = “Advanced Form Test” ;

$formurl = “http://www.URL.com/advancedform1.htm” ;

$errorurl = “http://www.URL.com/error.htm” ;

$thankyouurl = “http://www.URL.com/thankyou.htm” ;

$title = $_POST[‘title’} ;
$name = $_POST[‘name’] ;
$age = $_POST[‘age’] ;
$dob1 = $_POST[‘dob1’] ;
$dob2 = $_POST[‘dob2’] ;
$dob3 = $_POST[‘dob3′] ;
$email = $_POST[’email’] ;
$tel = $_POST[‘tel’] ;
$address = $_POST[‘address’] ;
$city = $_POST[‘city’] ;
$state = $_POST[‘state’] ;
$zip = $_POST[‘zip’] ;
$message = $_POST[‘message’] ;
$ref = $_POST[‘ref’] ;
$more1 = $_POST[‘more1’] ;
$more2 = $_POST[‘more2’] ;
$more3 = $_POST[‘more3′] ;
$http_referrer = getenv( “HTTP_REFERER” );

if (!isset($_POST[’email’])) {
header( “Location: $formurl” );
exit ;
}
if (empty($name) || empty($email) || empty($message)) {
header( “Location: $errorurl” );
exit ;
}
if (get_magic_quotes_gpc()) {
$message = stripslashes( $message );
}

$messageproper =

“This message was sent from:n” .
“$http_referrern” .

“————————- Message ————————-nn” .

“<strong>Name:</strong> $name n” .
“<strong>Message:</strong>n” .
“$message nn” .

“————————- Details ————————-nn” .

“<strong>Age:</strong> $age n” .
“<strong>Date Of Birth:</strong> $dob1 – $dob2 – $dob3 n” .
“<strong>Email:</strong> $email n” .
“<strong>Phone:</strong> $tel n” .
“<strong>Address:</strong>n” .
“$address n” .
“$state n” .
“$city n” .
“$zip nn” .

“<strong>Referral:</strong> $ref n” .
“<strong>More1:</strong> $more1 n” .
“<strong>More2:</strong> $more2 n” .
“<strong>More3:</strong> $more3 n” .

“n—————————————————-nn”;

mail($mailto, $subject, $messageproper, “From: “$name” <$email>nReply-To: “$name” <$email>nX-Mailer: chfeedback.php 2.02″ );
header( “Location: $thankyouurl” );
exit ;

?>
[/CODE]

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @fiasst spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...