Jump to content

Recommended Posts

why am I getting a unexpected T_string error in the following code? 

<!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=utf-8" />
<title>ordering doggy treats</title>
<link href="doggyTreats.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.information {
   padding-right: 50px;
}
td {
   border-top-color: #ff3300;
   border-right-color: #ff3300;
   border-bottom-color: #ff3300;
   border-left-color: #ff3300;
   padding-bottom: 2px;
}
h2 {
   text-align: center;
}
</style>
</head>

<body>
<?php
//error code 
echo <<<HEREDOC
<div id = "navBar">
<ul id="menu">
<li class="menuOption"><a href="index.html">Home</a></li>
<li class="menuOption"><a href="aboutUs.html">About Us</a></li>
<li class="menuOption"><a href="missionStatement.html">Mission Statement</a></li>
<li class="menuOption"><a href="products.html">Products</a></li>
<li class="menuOption"><a href="charities.html">Supportive Charities</a></li>
<li class="menuOption"><a href="order.html">Orders</a></li>
</ul>
</div>
<div id="logo"><img src="assets/logo.gif" width="182" height="123" alt="logo" /></div>
<form action="POST" method="post" name="order ">
<table id="order">  
<h2>Customer Information </h2> 
<tr>  
   <td>  First Name: </td>  <td>  <input name="fname" type="text" size="10" maxlength="20" /></td><td>  Last Name </td><td>  <input name="lname" type="text" size="10" maxlength="20" /></td>
</tr>
<tr>  
   <td> Address:</td><td>  <input name="address " type="text"  size="25" /></td>
    <td>  City</td><td>  <input name="city " type="text" size="15" maxlength="20" /></td>
    <td>State</td>
    <td>  Zip Code</td>  <td> <input name="zipcode" type="text" size="5" maxlength="5" /></td>
</tr>
<tr>
   <td>Phone<br />
    Please include area code</td><td><input name="phone" type="text" size="13" maxlength="13" /></td>
    <td>Faz:
    <td><input name="" type="text" size="13" maxlength="13" /></td>
</td>
<tr>
    <td>Email:</td><td><input name="email " type="text" size="15" maxlength="30" /></td>
</tr>
<tr>
   <td>Please choose Method of payment:</td><td> Check <input name="check " type="radio" value="Check " /> Money Order <input name="money " type="radio" value="Money order " />PayPal<input name="paypal" type="radio" value="Paypal" /></td>
</tr>
<tr>
    <td><h2>  Pet Information </h2> </td>
</tr>
<tr>
   <td>  Name: </td><td>  <input name="petName" type="text" size="10" maxlength="20" /></td><td>  Age:  </td><td><select name="age">  
HEREDOC;
  for ($age =1; $age <=20; $age ++)
    {
      print "<option value=\"age\">  $age</option>; 
   }
echo <<<HEREDOC
</tr>
<tr>
   <td><input name="Submit" type="button" value="Submit " /><input name="reset" type="button" value="Cancel " /></td>
</tr>
</table>
HEREDOC;
?>
</form> 
<div id = "footer">
Auntie Vic's Treatery <br />
PO Box 34092 <br />
Clermont, IN 46234<br />
317-701-0343 <br />
<a href="mailto:auntievics@gmail.com">Email Us</a>
</div>
</body>
</html>

 

MOD EDIT: code tags added.

Link to comment
https://forums.phpfreaks.com/topic/240915-syntax-error-unexpected-t_string/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.