homepage Welcome to WebmasterWorld Guest from 23.22.2.150
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Sending Email after form submit.
Get blank page upon submit..
Senmar50

10+ Year Member



 
Msg#: 10808 posted 6:10 pm on Nov 15, 2005 (gmt 0)

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>';

}

}

?>

 

dreamcatcher

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



 
Msg#: 10808 posted 9:33 pm on Nov 15, 2005 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved