Reply
form mail if statement help
Old 05-12-2004, 10:33 AM form mail if statement help
TMarie's Avatar
Novice Talker

Posts: 11
Location: Akron, OH
Okay, I'm about ready to lose my mind. I have been trying to figure out this form mail code for two days now... It works until I put in if statements... but I need them to check for certain blank fields.

I've tried putting them in several different ways with no avail. Right now I get this error when I hit submit on this page (http://www.glidersanonymous.com/gettogether.html):
Quote:
Parse error: parse error, unexpected $ in /www/t/tmarie820/htdocs/submitattendance.php on line 159
However, that line is my ending php tag.

Here is the code as it stands now:
Code:
<html>
<head>
<link rel="stylesheet" type="text/css" href="code.css" />
<LINK REL="SHORTCUT ICON" href="http://www.glidersanonymous.com/favicon.ico">

<title>Message Recieved</title>
</head>
<BODY>
<table border=0 cellpadding=0 cellspacing=0 width="100%">
<tr>
<td bgcolor="#ff9999" width=200></td>
<td bgcolor="#ffffff">
<img src="http://www.glidersanonymous.com/pictures/glidersanonlogo.jpg" border=0 width="300" height="124"></td>
<td bgcolor="#ffffff" align=center>
<A href="index.html">Home</A> | 
<A href="contact.html">Contact Us</A> | 
<A href="tmarie.html">About</A> 
</td>
</tr></table>
<br>
<table border=0 cellpadding=10 cellspacing=0>
<tr>
<td width=184 valign=top bgcolor=white>

  <LI><A href="whatisglider.html">About Gliders</A> 
  <LI><a href="store.html">Glider Store</a> 
  <LI><a target="_blank" href="http://www.glidersanonymous.com/bragpage">Brag Page Photos</a>
  <li><a target="_blank" href="http://www.glidersanonymous.com/forums/">Forums</a> 
  <LI><a target="_blank" href="helpdb.html">Help Database</a>
  <LI><a href="highway.html">Glider Highway</a> 
  <li><a href="projects.html">Glider Projects</a>
  <LI><A href="infolist.html">Info Sheets</A> 
  <LI><A href="storytime.html">GA Storytime</A> 
  <LI><A href="articles.html">Articles</A> 
  <LI><A href="links.html">Glider Links</A> 
  <li><a href="joeys.html">Joeys Available</a>
  <li><a href="tellafriend.html">Tell A Friend</a>
</UL>

</td>
<td width=1 bgcolor="#cc99ff"></td>
<td bgcolor=white>
<h1><font color="#cc99ff">Thank You!</H1>
<P>Your message has been submitted.  Thank you for signing up for the get together!  I will see you in August!</p>
<P>&nbsp;</p>
<P>&nbsp;</p>
<P>&nbsp;</p>
<P>&nbsp;</p>
<P>&nbsp;</p>
<P>&nbsp;</p>
</td>
</tr>
</table>

<DIV style="CLEAR: both"></DIV></DIV></BODY>
<script language=javascript 
<img src="http://ss.webring.com/navbar?f=j;y=tmarie820;u=10103050"></script>
<noscript>
<center>
<table bgcolor=gray cellspacing=0 border=2 bordercolor=white>
<tr><td><table cellpadding=2 cellspacing=0 border=0><tr><td align=center>
<font face=arial size=-1>This site is a member of WebRing. 
To browse visit <a href="http://ss.webring.com/navbar?f=l;y=tmarie820;u=10103050">
here</a>.</font></td></tr></table></td></tr></table></center></noscript>
<!-- CafePress Newsletter Subscription Box 4 Code Begins -->
<center><table width=468 height=60 cellpadding=3 cellspacing=0 bgcolor=#cc33ff
border=1 style="border: black 1px solid; border-collapse:collapse;">
<form method="post" action="http://www.cafeshops.com/cp/members/member_subscription.aspx">
<input name="storeid" value="glidersanon" type="hidden">
<input name="external" value="4" type="hidden">
<input name="emailtype" value="1" type="hidden">
<input name="cbstore" value="on" type="hidden">
<input name="successurl" value="http://www.glidersanonymous.com/newssuccess.html" type=hidden>
<input name="failureurl" value="http://www.glidersanonymous.com/newssorry.html" type=hidden>
<tr><td
style="font-size: 10pt; color:white; font-family:Century Gothic; line-height: 150%;" align=center>
Sign up to receive the GA newsletter, and get the latest news on our website delivered directly to your inbox!  
<input name="txtemail" type="text" size="20" maxlength="50"
value="enter your email" onFocus="this.value=''">
<input type="submit" value="go"></td></tr></form></table></center>
<!-- CafePress Newsletter Subscription Box 4 Code Ends -->
<!-- BEGIN WebSTAT Activation Code -->
<script type="text/javascript" language="JavaScript" src="http://hitswebstat.com/cgi-bin/wsv2.cgi?57306"></script>
<noscript>
<center>
<a href="http://www.webstat.com">
<img SRC="http://hits.webstat.com/scripts/wsb.php?ac=57306" border="0" alt="WebSTAT - Free Web Statistics"></a></noscript>
<!-- END WebSTAT Activation Code -->

<table border=0 cellpadding=0 cellspacing=0 align=center width="100%">
<tr>
<td bgcolor="#ffffff" align=center>
<P>copyright 2003 ::
<a href="mailto:designs@glidersanonymous.com?subject=Web Design (Gliders Anonymous)">TMarie Designs</a></P>
</td></tr></table>


</body>

</html>
<? 

$sendto = "tmarie@glidersanonymous.com"; 
$emailsubject = "Get Together Attendance"; 
$from = "From: $name <$email>";
$messageme = "\r\nName: $name\r\nEmail: $email\r\nScreenname: $screenname\r\nAddress: $address\r\nCity/State: $citystate\r\nPhone Number: $phone\r\nDays Attending: $friday $saturday $sunday $other\r\nOther Comments: \r\n$otherdaysattending\r\nNumber of Gliders: $numberofgliders\r\nNumber of Adults: $numberofadults\r\nNumber of Children: $numberofchild\r\nStaying in Hotel: $hotel\r\nAmusement Park: $amusementpark\r\nGift Exchange: $giftexchange\r\nPlanning Committee: $planningcommittee";

if ($submit) { 

   if ($name == "") 
       $message= "Please enter your name."; 
   if ($screenname == "") 
       $message= "Please enter your GA Screenname."; 
   if ($address == "") 
       $message= "Please enter your address."; 
   if ($citystate == "") 
       $message= "Please enter your city and state."; 
   if ($phone == "") 
       $message= "Please enter your contact phone number."; 
   if ($email == "") 
       $message= "Please enter a valid email address."; 
   if ($numberofgliders == "") 
       $message= "Please enter a number of gliders."; 
   if ($numberofadults == ""); 
       $message= "Please enter the number of adults attending."; 
   if ($numberofchild == ""); 
       $message= "Please enter the number of children attending."; 
        
if ($message) 

{ 

echo ($message); 
exit; 

} else { 

mail($sendto, $emailsubject, $messageme, $from);  

} 
} 

?>
Any guidance would be appreciated... I need this up asap.
TMarie is offline
Reply With Quote
View Public Profile Visit TMarie's homepage!
 
When You Register, These Ads Go Away!
Old 05-12-2004, 11:44 AM
WebWishMaster's Avatar
Skilled Talker

Posts: 76
Location: New York City
at quick glance, looks like you got an extra curly bracket } near the end of your script... just take out the one before ?>

WebWishMaster is offline
Reply With Quote
View Public Profile Visit WebWishMaster's homepage!
 
Old 05-12-2004, 11:47 AM
WebWishMaster's Avatar
Skilled Talker

Posts: 76
Location: New York City
oh no, I see your problem... the curly bracket is fine.. that was my mistake in reading

PHP Code:
   if ($numberofadults == ""); 
       
$message"Please enter the number of adults attending."
   if (
$numberofchild == ""); 
       
$message"Please enter the number of children attending."
take out the semi-colons after the parenthesis... should only be one after the end quotes like the rest of your statements
WebWishMaster is offline
Reply With Quote
View Public Profile Visit WebWishMaster's homepage!
 
Old 05-12-2004, 11:47 AM
TMarie's Avatar
Novice Talker

Posts: 11
Location: Akron, OH
That should be there to close the else statment at the top. When I do that I get the same error was getting before except for line 158.

Do I need the brackets after the else statement at all maybe?

If statements are always where I get confused, but I need these ones.
TMarie is offline
Reply With Quote
View Public Profile Visit TMarie's homepage!
 
Old 05-12-2004, 11:50 AM
TMarie's Avatar
Novice Talker

Posts: 11
Location: Akron, OH
this is what i have:

Code:
if ($name == "") {
echo "Please enter your name.";

} else {

if ($screenname == "") {
echo "Please enter your screenname.";

} else {

if ($address == "") {
echo "Please enter your address.";

} else {

if ($citystate == "") {
echo "Please enter your City and State.";

} else {

if ($phone == "") {
echo "Please enter your contact telephone number.";

} else {

if ($email == "") {
echo "Please enter your correct email address.  This will be used to confirm your registration.";

} else {

if ($numberofgliders == "") {
echo "Please enter the number of gliders you will be bringing.";

} else {

if ($numberofadults == "") {
echo "Please enter the number of adults (18+) attending.";

} else {

if ($numberofchild == "") {
echo "Please enter the number of children attending.";
I'm not seeing extra brackets... hmmm.... oh i see they were in my code before.. i've changed it since then still getting that stupid error tho.
TMarie is offline
Reply With Quote
View Public Profile Visit TMarie's homepage!
 
Old 05-12-2004, 11:58 AM
TMarie's Avatar
Novice Talker

Posts: 11
Location: Akron, OH
i got it.. could someone do me a favor and send a test email (filling out all the fields) I think there's a typo in a value set in my html code (but sometimes this pc has a tendency to not load new changes so i want to see if it's my pc or not)
TMarie is offline
Reply With Quote
View Public Profile Visit TMarie's homepage!
 
Old 05-12-2004, 01:47 PM
TMarie's Avatar
Novice Talker

Posts: 11
Location: Akron, OH
Nevermind, not working....

It will work if all the fields are filled in.

However, if a field that it is supposed to check for is blank, it will give the person the confirmation screen instead of an error screen and then I never get the email b/c it doesn't get that far in the code.

Anyone have any advice?
TMarie is offline
Reply With Quote
View Public Profile Visit TMarie's homepage!
 
Reply     « Reply to form mail if statement help
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13447 seconds with 12 queries