I got this error when I was running some code:
Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in C:\xampp\htdocs\scanner\mine.php on line 31
Line 31 is:
if($_POST['thename']) {
I'm getti开发者_如何学Pythonng it from:
echo '<h6>Settings</h6>';
echo '<form action="" method="post">';
echo '<b>Name:</b> <input type="text" name="thename" />';
echo '<br /><input type="submit" value="Submit" />';
echo '<hr><br />'
What's causing the parse error?
This is typically because the line above is missing an ending semi-colon.
For example:
echo '<hr><br />';
Likely you left out a semicolon on the previous line, making php think that there was something more to the previous line and not expect an if statement.
精彩评论