tlavelle Posted August 15, 2007 Share Posted August 15, 2007 Why does this: echo"<form method=\"POST\" action=\"$_SERVER['PHP_SELF']\" name=\"wercbench1\">"; Give me this: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\bench2\index2.php on line 41 Quote Link to comment https://forums.phpfreaks.com/topic/65077-parse-error-help/ Share on other sites More sharing options...
Psycho Posted August 15, 2007 Share Posted August 15, 2007 Please show a few lines before and after that line. Quote Link to comment https://forums.phpfreaks.com/topic/65077-parse-error-help/#findComment-324785 Share on other sites More sharing options...
flappy_warbucks Posted August 15, 2007 Share Posted August 15, 2007 personally i would have done this: echo"<form method=\"POST\" action=\"". $_SERVER['PHP_SELF']. "\" name=\"wercbench1\">"; Quote Link to comment https://forums.phpfreaks.com/topic/65077-parse-error-help/#findComment-324788 Share on other sites More sharing options...
tlavelle Posted August 15, 2007 Author Share Posted August 15, 2007 if (mysql_num_rows($year_result) > 0 or mysql_num_rows($industry_result)){ // yes // print them one after another if (!isset($_POST['wercbench1'])) { echo"<form method=\"POST\" action=\"<?php$_SERVER['PHP_SELF']; ?>\" name=\"wercbench1\">"; echo"<table style=\"width: 100%;\" border=\"1\" cellpadding=\"2\" cellspacing=\"2\">"; echo"<tbody>"; echo" <tr>"; echo" <td>Select the comparison year and group then click next"; echo" </td>"; echo" <td></td>"; echo" </tr>"; echo" <tr>"; echo" <td>"; echo" <select name=\"year\">"; while($row = mysql_fetch_row($year_result)) { echo"<option value=\"" .$row[0]. "\">".$row[0]."</option>"; } echo" </select>"; echo" </td>"; echo" <td></td>"; echo" </tr>"; echo" <tr>"; echo" <td>"; echo" <select name=\"industry\">"; while($row = mysql_fetch_row($industry_result)) { echo"<option value=\"" .$row[0]. "\">".$row[0]."</option>"; } echo" </select>"; echo"</td>"; echo" <td></td>"; echo" </tr>"; echo" <tr>"; echo" <td><input type=\"Submit\" value=\"Next\" name=\"wercbench1_next\"></button></td>"; echo" <td></td>"; echo" </tr>"; echo"</tbody>"; echo"</table>"; echo"</form>"; } } Quote Link to comment https://forums.phpfreaks.com/topic/65077-parse-error-help/#findComment-324790 Share on other sites More sharing options...
flappy_warbucks Posted August 15, 2007 Share Posted August 15, 2007 if (mysql_num_rows($year_result) > 0 or mysql_num_rows($industry_result)){ thats wrong if you want a OR statement you use || so here you go: if (mysql_num_rows($year_result) > 0 || mysql_num_rows($industry_result)){ there is alos semi colon here: echo"<table style=\"width: 100%;\" border=\"1\" cellpadding=\"2\" cellspacing=\"2\">"; change to: echo"<table style=\"width: 100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"2\">"; Quote Link to comment https://forums.phpfreaks.com/topic/65077-parse-error-help/#findComment-324795 Share on other sites More sharing options...
LiamProductions Posted August 15, 2007 Share Posted August 15, 2007 echo"<table style=\"width: 100%\;\" border=\"1\" cellpadding=\"2\" cellspacing=\"2\">"; You had a ; before the end of the line which tells the browser its the end of the line Quote Link to comment https://forums.phpfreaks.com/topic/65077-parse-error-help/#findComment-324801 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.