mindapolis Posted July 2, 2011 Share Posted July 2, 2011 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:[email protected]">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 More sharing options...
QuickOldCar Posted July 2, 2011 Share Posted July 2, 2011 change this: print "<option value=\"age\"> $age</option>; to this: print "<option value='age'> $age</option>"; Link to comment https://forums.phpfreaks.com/topic/240915-syntax-error-unexpected-t_string/#findComment-1237515 Share on other sites More sharing options...
Pikachu2000 Posted July 2, 2011 Share Posted July 2, 2011 Second request: When posting code, enclose it within the forum's . . . BBCode tags. Link to comment https://forums.phpfreaks.com/topic/240915-syntax-error-unexpected-t_string/#findComment-1237534 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.