datoshway Posted March 20, 2010 Share Posted March 20, 2010 Getting a error, can't figure it out. Heres the error and code below Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /myaccount.php on line 159 <? if($rewards) { foreach ($rewards as $key=>$value) { echo "<tr align=\"left\" valign=\"top\">"; echo " <br> <form name = \"reward$value[id]\" method = \"post\" action = \"$linkout\"> <input type = \"hidden\" name = \"CardNumber\" value = \"$subinfo[goldcard]\"> <input type = \"hidden\" name = \"LastName\" value = \"$subinfo[lname]\"> <input type = \"hidden\" name = \"FirstName\" value = \"$subinfo[fname]\"> <input type = \"hidden\" name = \"Address1\" value = \"$subinfo[address]\"> <input type = \"hidden\" name = \"Address2\" value = \"\"> <input type = \"hidden\" name = \"City\" value = \"$subinfo[city]\"> <input type = \"hidden\" name = \"State\" value = \"$subinfo[state]\"> <input type = \"hidden\" name = \"ZIP\" value = \"$subinfo[zipcode]\"> <input type = \"hidden\" name = \"Phone1\" value = \"$subinfo[phone]\"> <input type = \"hidden\" name = \"Email\" value = \"$subinfo[email]\"> <input type = \"hidden\" name = \"PW\" value = \"$subinfo[password]\"> <input type = \"hidden\" name = \"PromoCode\" value = \"$value[promoid]\"> <input type = \"hidden\" name = \"HotelID\" value = \"$hotelID\"> </form> "; if ($value[news]<>"on") { echo "<a href=\"#\" onclick = \"document.reward$value[id].submit()\"><img src="members_new/images/book.png" width="101" height="31"></a></td>"; } echo "</tr><tr><td colspan = \"2\"> <BR><BR><BR></td>"; } } else { ?> </tbody> <tr> <td width="220" height="90" class="style8"><span class="style7"><strong>Sorry:</strong><br /> <span class="style8">No rewards offers are available at this time. Please check back later.</span><br /> </span></td> </tr> <? } ?> Link to comment https://forums.phpfreaks.com/topic/195873-help-parse-error/ Share on other sites More sharing options...
trq Posted March 20, 2010 Share Posted March 20, 2010 echo "<a href=\"#\" onclick = \"document.reward{$value['id']}.submit()\"><img src=\"members_new/images/book.png\" width=\"101\" height=\"31\"></a></td>"; ps: Non-numeric array indexes should be surrounded by quotes also, so these.... <input type = \"hidden\" name = \"CardNumber\" value = \"$subinfo[goldcard]}\"> should be.... <input type = \"hidden\" name = \"CardNumber\" value = \"{$subinfo['goldcard']\"> Link to comment https://forums.phpfreaks.com/topic/195873-help-parse-error/#findComment-1028876 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.