remshad Posted April 20, 2009 Share Posted April 20, 2009 when i try to make a script that omit desired number of text box for entering data when i run the script error showing "Parse error: parse error, expecting `','' or `';'' in L:\xampp\htdocs\forums\me\PROJECT\first.php on line" i below add the php script echo "<form action="finish.php" method="post">"; echo "STD: <input type="text" name="std" />"; echo "DIVISION:<input type="text" name="division" />"; for($i=1;$i<=$number;$i++) { echo "enter".$i." th subject =: <input type="text" name="".$i."std" />"; } echo "<input type="submit" />"; could you help me for fix this problem Link to comment https://forums.phpfreaks.com/topic/154841-solved-parse-error-parse-error-expecting-or/ Share on other sites More sharing options...
Yesideez Posted April 20, 2009 Share Posted April 20, 2009 Either escape the " in the middle or enclose in single quotes. Try this: echo '<form action="finish.php" method="post">'; echo 'STD: <input type="text" name="std" />'; echo 'DIVISION:<input type="text" name="division" />'; for($i=1;$i<=$number;$i++) { echo 'enter'.$i.' th subject =: <input type="text" name="'.$i.'std" />'; } echo '<input type="submit" />'; Not sure what the line in conditionals is meant to do... Link to comment https://forums.phpfreaks.com/topic/154841-solved-parse-error-parse-error-expecting-or/#findComment-814348 Share on other sites More sharing options...
Yesideez Posted April 20, 2009 Share Posted April 20, 2009 btw, welcome to the site! You can escape like this: echo "<form action=\"finish.php\" method=\"post\">"; Link to comment https://forums.phpfreaks.com/topic/154841-solved-parse-error-parse-error-expecting-or/#findComment-814358 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.