Jump to content


PHP email script Help

php coding script error

  • Please log in to reply
1 reply to this topic

#1 deanodino1



  • New Members
  • Pip
  • 1 posts

Posted 29 July 2013 - 12:06 PM

Could anyone explain why my script just isnt working? I dont understand PHP and would be enterally greatful. Im told


Parse error: syntax error, unexpected T_ECHO in /home/content/65/11493065/html/PHP/html_form_send.php on line 265


which is the echo at the end


Many thanks


/* subject and email variables */

	$subject = 'form completion';
	$to = 'office@english-centre.co.uk';
/* gathering data variable */

	$name = $_POST['name'];
	$telephone = $_POST['telephone'];
	$email = $_POST['email'];
	$type = $_POST['type'];
	$ability = $_POST['ability'];
	$previous_lessons = $_POST['previous_lessons'];
	$comments = $_POST['comments'];
	$found_site = $_POST['found_site'];
	$body = <<<EOD
Client Name: $name <br>
Telephone: $telephone <br>
Email: $email <br>
Intrested in: $type <br>
Current ability: $ability <br>
Previous lessons: $previous_lessons <br>
Any comments: $comments <br>
found site through: $found_site <br>

	$headers = "From: $email\r\n";
	$headers .= "Content-type: text/html\r\n";
	$success = mail ($to, $subject, $body, $headers);
/* results rendered as HTML */

	$theResults = <<<EOD
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">  

<!-- #BeginTemplate "Template.dwt" -->


<meta content="en-gb" http-equiv="Content-Language">
<!-- #BeginEditable "doctitle" -->
<title>The English Centre&nbsp;&nbsp; 07905080578</title>
<!-- #EndEditable -->
<title>The English Centre</title>
    <link rel="stylesheet" href="../JS/gilbitron-Lean-Slider-ffe9a31/demo/style.css" type="text/css" media="screen" />
    <script src="../JS/gilbitron-Lean-Slider-ffe9a31/demo/scripts/modernizr-2.6.1.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
    <script src="../JS/gilbitron-Lean-Slider-ffe9a31/lean-slider.js"></script>
    <link rel="stylesheet" href="../JS/gilbitron-Lean-Slider-ffe9a31/lean-slider.css" type="text/css" />
    <link rel="stylesheet" href="../JS/gilbitron-Lean-Slider-ffe9a31/demo/sample-styles.css" type="text/css" />
	<link href="../CSS/styles.css" rel="stylesheet" type="text/css" media="screen">

<style type="text/css">

.auto-style1 {
	margin-bottom: 1em;



<div id="wrapper">

	<div id="top">
		<div id="logo">
 			<img alt="English Centre" height="220" src="../Images/book-covered-in-uk.jpg" width="606"></div>
 		<div id="language">
 			<h3 class="auto-style1">The English Centre </h3><br>07905080578<br>
			<a href="mailto:Office@english-centre.co.uk">
			Office@english-centre.co.uk</a><br><br>Language Select<br><br>

	<div id="topna">
			<li><a href="../default.html" class="button">Home</a></li>
			<li><a href="../French/default.html" class="button">About Us</a></li>
			<li><a href="courses.html" class="button">Courses</a></li>
			<li><a href="Teachers.html" class="button">Teachers</a></li>
			<li><a href="FAQ.html" class="button">FAQ</a></li>
			<li><a href="Contact.html" class="button">Contact</a></li>
	 <div class="slider-wrapper">
        <div id="slider">
            <div class="slide1">
                <img src="../Images/big ben.jpg" alt="" />
            <div class="slide2">
                <img src="../Images/main/hills.jpg" alt="" />
            <div class="slide3">
                <img src="../Images/main/talking people.jpg" alt="" />
            <div class="slide4">
                <img src="../Images/main/towerbridge.jpg" alt="" />
        <div id="slider-direction-nav"></div>
        <div id="slider-control-nav"></div>
    <script type="text/javascript">
    $(document).ready(function() {
        var slider = $('#slider').leanSlider({
            directionNav: '#slider-direction-nav',
            controlNav: '#slider-control-nav'

	<div id="subbanner">
		<marquee behavior="scroll" direction="left"><img alt="English lessons" height="72" src="../Images/main/scroll%20text.jpg" width="1188"></marquee>

	<!-- #BeginEditable "Content" -->

	<div id="wrapper0">

	<div id="content">
	<h1>Contact Us</h1>
	<p>To find out more information complete the form and we will be in touch soon</p>
		<div id="form" style="width: 673px">
		<form name="feedback" action="../PHP/html_form_send.php" method="post" style="width: 638px">
			<li> <label for="name">Name</label> 
			<input type="text" name="name" id="name"> </li>

			<li> <label for="telephone">Telephone</label> 
			<input type="tel" name="telephone" id="telephone"> </li>
			<li> <label for="email">Email</label> 
			<input type="email" name="email" id="email"> </li>
			<li> <label for="type">Type of Lesson</label>  
			<select name="type">
 			 <option value="single">Single Lessons</option>
  			<option value="package">Lesson Package</option>
  			<option value="friends">Learn with a Friend</option>
			<li> <label for="ability">Current ability</label>  
			<select name="ability">
 			<option value="beginner">Beginner</option>
  			<option value="beyond beginner">Beyond Beginner</option>
  			<option value="intermediate">Intermediate</option>
  			<option value="fair">Fair</option>
  			<option value="fluent">Fluent</option>
  			<li> <label for="previous_lessons">Previous Lessons?</label>  
			<select name="previous_lessons">
			<option value="no">No</option>
 			<option value="school only">Learned only in School</option>
  			<option value="over5years">Over 5 Years ago</option>
  			<option value="5years">last 5 Years </option>
  			<option value="2 years">Last 2 Years</option>
  			<option value="pc only">Only on the Computer</option>

			<li> <label for="comments">Comments</label> 
			<textarea name="comments" style="width: 278px; height: 117px"></textarea> </li>
			<li> <label for="found_site">How did you find us?</label>  
			<select name="found_site">
 			<option value="google">Google</option>
  			<option value="bing">Bing</option>
  			<option value="yahoo">Yahoo</option>
  			<option value="gumtree">Gumtree</option>
  			<option value="friend">Friend</option>
  			<option value="flyer">Flyer</option>
  			<option value="advert">Advert</option>
  			<option value="other">Other</option>
			<li> <label for="send">Send it</label>  
			<input name="Submit1" type="submit" value="submit" />
<h2 style="width: 667px"> Our goal is to help you speak fluently!</h2>


<div id="wrapper1">
	<div id="rightside" style="width: 292px">
	<h2> &nbsp;Our Other Services</h2>
		<li>Dissertation Writing/Proofreading 
		<li>Essay Writing Service 
		<li>CV Writing Service 
		<li>Essay Writing Skills Class 
		<li>Business Plan Writing 
		<li>Marketing Plan Writing 
		<li>PowerPoint Writing 
		<p>If you require our other services or would like to submit a CV to work 
	for the English Centre please use the email above</p>
		<img alt="Learn English" height="253" src="../Images/main/students.jpg" width="313"></h3>

	<!-- #EndEditable -->
<!-- #BeginEditable "right%20side" -->

	<!-- #EndEditable -->

	<div id="footer">
	<p>&copy; Copywrite 2013 - The English Centre, London, UK</p>


<!-- #EndTemplate -->

echo "$theResults";		


#2 TOA


    Devil's Advocate

  • Members
  • PipPipPip
  • 624 posts
  • LocationMinnesota, U.S.A

Posted 29 July 2013 - 02:12 PM

Looks like you forgot a ; after EOD

Ordo Ab Chao
Insanity: doing the same thing over and over again and expecting different results - Einstein

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users