Welcome to WebmasterWorld Guest from 54.145.167.92

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Sending Email after form submit.

Get blank page upon submit..

   
6:10 pm on Nov 15, 2005 (gmt 0)

10+ Year Member



Hi All,

I am trying to send an email to the user after he/she submits the form. I get a blank page. My code is find, without the "send email section". Can you look at that section and see what (") or (') or (;) or (;)is out of place.

Thanks
SenMar

<?php

if(!isset($_POST['submit']))

}else{
if(!isset($_POST['first_name']) strlen($_POST['first_name']) <= 0)
{
echo 'Error: You did not enter first name.<br />';
exit();
}
if(!isset($_POST['last_name']) strlen($_POST['last_name']) <= 0)
{
echo 'Error: You did not enter your last name.<br />';
exit();
}
if(!isset($_POST['member_addressl']) strlen($_POST['member_address']) <= 0)
{
echo 'Error: You did not enter your address.<br />';
exit();
}
if(!isset($_POST['address2']) strlen($_POST['address2']) <= 0)
{
echo 'Error: You did not enter your address2<br />';
exit();
}
if(!isset($_POST['member_city']) strlen($_POST['member_city']) <= 0)
{
echo 'Error: You did not enter your City<br />';
exit();

}
if(!isset($_POST['member_state']) strlen($_POST['member_state']) <= 0)
{
echo 'Error: You did not enter your State<br />';
exit();

}
if(!isset($_POST['member_email']) strlen($_POST['member_email']) <= 0)
{
echo 'Error: You did not enter your Email Address<br />';
exit();
}
if(!isset($_POST['membership']) strlen($_POST['membership']) <= 0)
{
echo 'Error: You did not enter your Membership Level<br />';
exit();

}

{
echo '<b><center>Thank you for our Membership Application is being processed.</center></b><br/><br/>';

}

//send mail.

$to = $_POST['Email'];
$subject = "Thank you for";
$message .= "First Name: " . $_POST['first_name'] . "\n";
$message .= "Last Name: " . $_POST['last_name'] . "\n";
$message .= "Email: " . $_POST['member_email'] . "\n";
$message .= "Joined the blah blah.....\n";
$message .= "Send membership information asap";

if (mail ($to, $subject, $message, 'From: $EMAIL\n')) {

echo 'Again....Thanks for joining.<a href="#">
Back To Message Board</a>';

}

}

?>

9:33 pm on Nov 15, 2005 (gmt 0)

WebmasterWorld Senior Member dreamcatcher is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Hi,

A quick look at your code tells me the first part of your if statement is going to generate a parse error.


if(!isset($_POST['submit']))

}else{

The opening if statement has no opening brace but it does have a closing brace.

dc