fr33fr0mlif3 Posted October 9, 2008 Share Posted October 9, 2008 So I have looked around to figure out what would be causing this issue. I have heard several things. I have tried going from <?php to <? and had no luck. I still get the same error. This has been bugging me for the past couple hours, so I'm giving up and coming up for some help. Here is the code. <?php // Require the script used to handle javascript validation. require("_class.SimpleForm.php"); $form = new SimpleForm(); // Your Required Fields. $form->addField("Name", "name", "required=text"); $form->addField("Valid Email", "email", "required=email"); $form->addField("Phone Number", "phone", "required=text"); $form->addField("Site Description", "sitedescription", "required=text"); if (!empty($_POST['submit'])) { // They submitted. Call in the mailer class. require("class.phpmailer.php"); $mail = new PHPMailer(); // Where is the email going? $mail->AddAddress("[email protected]"); // Other email details. $mail->Subject = "Design Quote Received"; $mail->From = "[email protected]"; $mail->FromName = "Do Not Reply"; // This is the body of the email to be sent. $body = <<< Body We have received a design quote from the website. The information is as follows: Name: {$_POST['name']} Email Address: {$_POST['email']} Phone Number: {$_POST['phone']} Best Contact Time: {$_POST['contactTime']} Web Design Description: {$_POST['sitedescription']} $mail->Body = $body; // Send the email! $mail->Send(); $sent = true; // Redirect them to our "Payment" page. header("Location: designsubmit.html"); exit(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Kilo Hosting Solutions - Services</title> <link href="style.css" rel="stylesheet" type="text/css"> <script language="JavaScript" 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> <?php echo $form->createJavascriptVal() ?> What this is above is a form mail, obviously, and a flash banner in the middle. I had a friend help me out with this before and I'm trying replicate what he did. I'm not sure if it is the flash banner in the way or not, but thats why I come to you. Here is the code for the form... <form method="POST" action="services.php" onSubmit="return SimpleFormValidatefrom1(this)"> <p>Name: <input type="text" size="44" name="name"> <p>Email: <input type="text" size="45" name="email"> <p>Phone Number: <input type="text" size="36" name="phone"> <p>Contact Time: <input type="text" size="37" name="contacttime"> <p>Description: <textarea name="sitedescription" cols="60" rows="10"></textarea> <p align="right"><input type="submit" name="submit" value="Submit"> </form> This is everything and anything on this page associated with php and the form. The error code I get is Parse error: syntax error, unexpected $end in /home/kilogame/public_html/test/services.php on line 184 Line 184 is the last line in my code which is wrapping up html and body. Link to comment https://forums.phpfreaks.com/topic/127646-solved-unexpected-end-in/ Share on other sites More sharing options...
DarkWater Posted October 9, 2008 Share Posted October 9, 2008 That error typically means that you missed a }, but in your case, you missed a semicolon to finish off that last statement. Link to comment https://forums.phpfreaks.com/topic/127646-solved-unexpected-end-in/#findComment-660549 Share on other sites More sharing options...
fr33fr0mlif3 Posted October 9, 2008 Author Share Posted October 9, 2008 I'm no coding genius, I'm going off of a previous site... where should i be putting this ":" Link to comment https://forums.phpfreaks.com/topic/127646-solved-unexpected-end-in/#findComment-660563 Share on other sites More sharing options...
DarkWater Posted October 9, 2008 Share Posted October 9, 2008 A semicolon is a ;, by the way, and it's used in almost every programming language to finish off a statement. Add it after: echo $form->createJavascriptVal() Link to comment https://forums.phpfreaks.com/topic/127646-solved-unexpected-end-in/#findComment-660564 Share on other sites More sharing options...
PFMaBiSmAd Posted October 9, 2008 Share Posted October 9, 2008 After you correct that problem (the ; is actually optional right before a closing ?> tag), your <<<Body heredoc quoted string is missing a closing tag (or if it is present it does not start in column one on a line by itself.) Link to comment https://forums.phpfreaks.com/topic/127646-solved-unexpected-end-in/#findComment-660568 Share on other sites More sharing options...
fr33fr0mlif3 Posted October 9, 2008 Author Share Posted October 9, 2008 <?php echo $form->createJavascriptVal() ;?> <?php echo $form->createJavascriptVal(); ?> I tried both of these and it didn't correct the issue. Link to comment https://forums.phpfreaks.com/topic/127646-solved-unexpected-end-in/#findComment-660569 Share on other sites More sharing options...
fr33fr0mlif3 Posted October 9, 2008 Author Share Posted October 9, 2008 I added Body; And it solved the issue. Thanks ppl Link to comment https://forums.phpfreaks.com/topic/127646-solved-unexpected-end-in/#findComment-660579 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.