shadowayex Posted June 1, 2008 Share Posted June 1, 2008 Ok, I've been editing my PHP pages a bit so that instead of echoing the HTML, I close of the PHP at the end of an if statement, write the HTML, then open the PHP back up. I do it a lot throughout the code, but there seems to be a syntax error that I'm not sure why it is. Here's an example: if($_SESSION['logged_in'] != true) {?> <form action="messages.php?mode=login" method="post"> <div> Username: <input type="text" name="username" value="" /><br /> Password: <input type="password" name="password" value="" /><br /> <input type="submit" name="submit" value="Login" /> </div><!-- 50 --> </form><?php }else {?> The problem is the } on line 52. The comment <!-- 50 --> is like 50, for a little extra information. Is my syntax actually wrong? I just recently learned about being able to close in the middle of a statement, so I'm not sure out to effectively use it. Can someone tell me what is wrong. Link to comment Share on other sites More sharing options...
Wander Posted June 1, 2008 Share Posted June 1, 2008 can you show some more of the code and what error it gives? the syntax of what you posted isnt really wrong as far as i can see Link to comment Share on other sites More sharing options...
shadowayex Posted June 1, 2008 Author Share Posted June 1, 2008 Nevermind, I found my error. I forgot to open the PHP back up after a previous close . But I have more syntax errors to go through so I might post here again. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.