Jump to content

Parse error: parse error, unexpected T_VARIABLE


michaelguild13

Recommended Posts

Hi, I am new to php and mysql and have been having trouble with this emaler form which I've been working on. if anyone could help me with this, you would be a lifesaver (my eyes are killing me).This is the subscription page:http://www.mmacdc.com/subscribe.phpThis is the Thankyou page which is giving me errors:http://www.mmacdc.com/thankyou.phpit says that the error is located in line 66 but I dont see anything.....This is the code for the Thankyou Page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title></title><script type="text/JavaScript"><!--function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}//--></script></head><body onload="MM_preloadImages('images/buttons/about_over.jpg','images/buttons/current_over.jpg','images/buttons/subscribe_over.jpg','images/buttons/advertise_over.jpg','images/buttons/contact_over.jpg')"><?php 				//**************MAIN MENU****************				SaveData();				//EmailRSVP();				//EmailClient();		   function SaveData(){							$tDate = date("m\/d\/Y");				$bFName = $_POST["FirstName"];				$bMName = $_POST["MiddleName"];				$bLName = $_POST["LastName"];				$rFullName = $bFName. " " .$bMName." " .$bLName;				$bAdd = $_POST["Address"];				$bCity = $_POST["City"];				$bState = $_POST["State"];				$bZip = $_POST["Zipcode"];				$bCountry = $_POST["Country"];				$bTel = $_POST["Tel"];				$bFax = $_POST["Fax"];				$bEmail = $_POST["Email"];						$sMail = "michael@trivision.tv";				//$sMail = "admin@trivision.tv";				//Process Email Registration				$to  = $sMail;								$subject = 'Confirmation'				$message = '<table width="388"  border="0" align="center" cellpadding="0" cellspacing="0" class="BodyPagraph">				                          <tr>                    <th align="right" valign="middle" scope="row">DATE:</th>                                 <td>'.$tDate.' </td>                  </tr>                  <tr>                    <th align="right" valign="top" scope="row"> </th>                    <td> </td>                    <td> </td>                  </tr>                  <tr>                    <th width="40%" align="right" valign="top" scope="row"><div align="right"><span class="style1">*</span>FIRST NAME:</div></th>                    <td width="2%"> </td>                    <td>'.$bFName.'</td>                  </tr>                  <tr>                    <th align="right" valign="top" scope="row"><div align="right">MIDDLE NAME:</div></th>                    <td> </td>                    <td>'.$bMName.'</td>                  </tr>                  <tr>                    <th align="right" valign="top" scope="row"><span class="style1">*</span>LAST NAME </th>                    <td> </td>                    <td>'.$bLName.'</td>                  </tr>                  <tr>                    <th width="40%" align="right" valign="top" scope="row"> </th>                    <td> </td>                    <td> </td>                  </tr>                  <tr>                    <th colspan="3" align="right" valign="top" scope="row"><div align="center"><br />                BILLING ADDRESS <br />                    </div></th>                  </tr>                  <tr>                    <th width="40%" align="right" valign="middle" scope="row"><div align="right"><span class="style1">*</span>Street Address:</div></th>                    <td width="2%"> </td>                    <td>'.$bAdd.'</td>                  </tr>                  <tr>                    <th align="right" valign="middle" scope="row"><span class="style1">*</span>City:</th>                    <td width="2%"> </td>                    <td>'.$bCity.'</td>                  </tr>                  <tr>                    <th align="right" valign="middle" scope="row"><span class="style1">*</span>State/Province:</th>                    <td width="2%"> </td>                    <td>'.$bState.'</td>                  </tr>                  <tr>                    <th align="right" valign="middle" scope="row"><span class="style1">*</span>Zip/Postal Code:</th>                    <td width="2%"> </td>                    <td>'.$bZip.'</td>                  </tr>                  <tr>                    <th align="right" valign="middle" scope="row"><span class="style1">*</span>Country:</th>                    <td width="2%"> </td>                    <td>'.$bCountry.'</td>                  </tr>                   <tr>                    <th width="40%" align="right" valign="middle" scope="row"><div align="right"><span class="style1">*</span>TEL:</div></th>                    <td width="2%"> </td>                    <td>'.$bTel.'</td></td>                  </tr>                  <tr>                    <th align="right" valign="middle" scope="row"><div align="right">FAX:</div></th>                    <td> </td>                    <td>'.$bFax.'</td>                  </tr>                  <tr>                    <th width="40%" align="right" valign="middle" scope="row"> </th>                    <td> </td>                    <td> </td>                  </tr>                  <tr>                    <th width="40%" align="right" valign="middle" scope="row"><div align="right"><span class="style1">*</span>E-MAIL:</div></th>                    <td width="2%"> </td>                    <td>'.$bEmail.'</td>                  </tr>                  <tr>                    <th width="40%" align="right" valign="top" scope="row"><div align="right"></div></th>                    <td width="2%"> </td>                    <td> </td>                  </tr>                  <tr>                    <th align="right" valign="top" scope="row"> </th>                    <td> </td>                    <td> </td>                  </tr>                                            <tr>                    <th align="right" valign="top" scope="row"> </th>                    <td> </td>                    <td> </td>                  </tr>                  <tr>                    <th height="12" colspan="3" align="right" valign="top" scope="row"><div align="right"></div></th>                  </tr>                                <tr>                    <th colspan="3" align="right" valign="top" scope="row"> </th>                  </tr>                </table>';								// To send HTML mail, the Content-type header must be set				$headers  = 'MIME-Version: 1.0' . "\r\n";				$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";				// Additional headers				$headers .= 'From: '.$rFullName.'<'.$bEmail.'>' . "\r\n";				//$headers .= 'Cc: @trivisionnet.com' . "\r\n";				//$headers .= 'Bcc: Admin <@trivision.tv>' . "\r\n";				// Mail it				mail($to, $subject, $message, $headers);							}?><table width="409" border="0"cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">          <tr>            <td align="left" valign="top"><div align="center"><br />                    <span header_1"><strong>THANK YOU</strong></span><br />                    <br />            </div></td>          </tr>          <tr>            <td align="left" valign="top"><table width="388"  border="0" align="center" cellpadding="0" cellspacing="0" BodyPagraph">                <tr>                  <th height="15" align="right" valign="top" background="images/payment_bck.jpg" scope="row"> </th>                  <td height="15" background="images/payment_bck.jpg"> </td>                  <td height="15" background="images/payment_bck.jpg"> </td>                </tr>                <tr>                  <th colspan="3" align="right" valign="top" scope="row"><div align="left">                      <p align="justify">Dear  Sir/Madame: <br />                          <br />                Thank you for subscrbing with us today <span style1">                <?php					$today = getdate();					echo $today['month'];					echo " ";					echo $today['mday'];					echo ", ";					echo $today['year'];?>                </span>. <br />                <br />                <br />                For payment confirmation inquiries or subscription status, please contact:<br />                <br />                <br />                      </p>                  </div></th>                </tr>                <tr>                  <th colspan="3" align="right" valign="top" scope="row"> </th>                </tr>                <tr>                  <th align="right" valign="middle" scope="row"> </th>                  <td> </td>                  <td> </td>                </tr>                <tr>                  <th align="right" valign="middle" scope="row"> </th>                  <td> </td>                  <td> </td>                </tr>                <tr>                  <th colspan="3" align="right" valign="middle" scope="row"><div align="left">Please check your email account <span style3"><?php echo $_POST["Email"]; ?></span></div></th>                </tr>                <tr>                  <th width="40%" align="right" valign="top" scope="row"><div align="right"> </div></th>                  <td width="2%"> </td>                  <td><input name="Return" type="button"  id="Return" value="Close" tabindex="16" onclick="java script:window.close();" /></td>                </tr>              </table>                <p BodyPagraph"> </p></td>          </tr>        </table></body></html>

Link to comment
Share on other sites

Change:

$subject = 'Confirmation'$message = '<table width="388" border="0" align="center" cellpadding="0" cellspacing="0" class="BodyPagraph">

To:

$subject = 'Confirmation';$message = '<table width="388" border="0" align="center" cellpadding="0" cellspacing="0" class="BodyPagraph">

However this is only one of many problems. When I run it I get 12 notices, 1 Debug warning, and 2 strict errors. I will edit this post when I fix the problems.Edit: The only real issue is that you are using the server's timezone in 2 separate locations, which is not safe to rely on. You can change it though. Read about timezones. They are on lines 47, and 209.

Link to comment
Share on other sites

Change:
$subject = 'Confirmation'$message = '<table width="388" border="0" align="center" cellpadding="0" cellspacing="0" class="BodyPagraph">

To:

$subject = 'Confirmation';$message = '<table width="388" border="0" align="center" cellpadding="0" cellspacing="0" class="BodyPagraph">

However this is only one of many problems. When I run it I get 12 notices, 1 Debug warning, and 2 strict errors. I will edit this post when I fix the problems.

THX!! :) my eyes cant focus any more
Link to comment
Share on other sites

THX!! :) my eyes cant focus any more
You also left the closing single quote off of the end of line 66 and the semicolon.You have
$message = '<table width="388" border="0" align="center" cellpadding="0" cellspacing="0" class="BodyPagraph">

It should be

$message = '<table width="388" border="0" align="center" cellpadding="0" cellspacing="0" class="BodyPagraph">';

Link to comment
Share on other sites

No. The $message variable continues on down below to print out an entire HTML block. Leave it as is except for the one semicolon before the message.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...