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> </p>
<P> </p>
<P> </p>
<P> </p>
<P> </p>
<P> </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.
|