georegjlee Posted March 6, 2007 Share Posted March 6, 2007 I'm having trouble with this simple piece of code. I want to add a checkbox to the end of the table which I can do in html but when I try do it through PHP I get this error. Parse error: parse error, unexpected T_STRING in C:\wamp\www\waterways1\admin\Problem_List.php on line 43 Here is a piece of the problem code. <form id="form1" name="form1" method="post" action=""> <table border = "1" cellpadding = "3" cellspacing = "2"> <?php for ( $counter = 0; $row = mysql_fetch_row($result); $counter++) { print( "<tr>"); foreach ( $row as $key => $value ) print ( "<td>$value</td>" ); print ( "<td>Check box to verify</td>"); print ( "<td><input type="checkbox" name="option1" value="Milk"></td>" ); print ( "</tr>" ); } //close the connection mysql_close($dbhandle); ?> </table> <input type="submit" value = "Update Problems" /> </form> Link to comment https://forums.phpfreaks.com/topic/41470-help-me-please/ Share on other sites More sharing options...
boo_lolly Posted March 6, 2007 Share Posted March 6, 2007 you have to escape the quotes: print( "<td><input type=\"checkbox\" name=\"option1\" value=\"Milk\"></td>" ); Link to comment https://forums.phpfreaks.com/topic/41470-help-me-please/#findComment-200913 Share on other sites More sharing options...
georegjlee Posted March 6, 2007 Author Share Posted March 6, 2007 That worked perfect. Go raibh milé maith agat. Link to comment https://forums.phpfreaks.com/topic/41470-help-me-please/#findComment-200923 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.