unexpected $end error

From what I gather this is usually an error you get when you miss closing brackets. However unless I’m blind my brackets are closed.

Assignment #01 <?php if($_POST) { $subject = $_POST['subject']; $name = $_POST['name']; $email = $_POST['email']; $comments = $_POST['comments']; print("You have entered the following:
"); print "subject: $subject
"; print "name: $name
"; print "email: $email
"; print "comments: $comments
"; } else { ?>
  <!-- create table to center contact form -->
  <table width="500" align="center" cellpadding="5">
    <tr><td>
    <!-- start of form -->
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
          <div align="center"> 
            <h3>The ACME Widget Company<br>
              Customer Contact Form</h3>
          </div>
          <p align="center">Please fill out the following form.</p>
  		
		  <!-- capture variables 'subject', 'name', 'email', 'comments' -->
          <b>Subject:</b><img src="../dot_FFFFFF.gif" width="30" height="1"> 
          <input type="text" name="subject" /><br /><br />
          <b>Your Name:</b><img src="../dot_FFFFFF.gif" width="4" height="1"> 
          <input type="text" name="name" /><br /><br />
          <b>Your E-mail:</b><img src="../dot_FFFFFF.gif" width="2" height="1"> 
          <input type="text" name="email" /><br /><br />
          <b>Comments:</b> <img src="../dot_FFFFFF.gif" width="6" height="1"> 
          <textarea name="comments" rows="8" cols="40"></textarea>
          <br /><br />
    <input type="submit" value="Submit" />
    </form>
    </td></tr>
  </table>
  }

Well, the good news is you’re not blind, the bracket is there, the bad news is you did make a small oversight. The last bracket isn’t enclosed in “<?php ?>” tags. Try that and it should work better. :)

Sponsor our Newsletter | Privacy Policy | Terms of Service