Daleeburg Posted September 29, 2007 Share Posted September 29, 2007 I cant find the error Unexpected '}' in line 23 <?php IF(isset($_SESSION['id'])){ ?> <h2>Add a User</h2> <? IF($_POST['create'] == "Add"){ # Form has been submited }ELSE{ # form to create a user. ?> <form action="index.php?mode=adduser" method="POST"> Username:<br> <INPUT type="text" name="name"><br> Password:<br> <INPUT type="password" name="pass"><br> Retype Password:<br> <INPUT type="password" name="cpass"><br> <INPUT type="submit" name="create" value="Add"><br> </form> <?php }; }ELSE{ # <-- this is the problem line echo '<p>You must be logged in to see this</p>'; }; ?> it is probably really simple, but i have been looking at it for 30 mins and dont have a clue why it is kicking out the error. thanks ~d Quote Link to comment https://forums.phpfreaks.com/topic/71165-solved-i-dont-see-the-error/ Share on other sites More sharing options...
Wuhtzu Posted September 29, 2007 Share Posted September 29, 2007 Please point out what line is no. 23 Quote Link to comment https://forums.phpfreaks.com/topic/71165-solved-i-dont-see-the-error/#findComment-357939 Share on other sites More sharing options...
Daleeburg Posted September 29, 2007 Author Share Posted September 29, 2007 I did, it has # <--- this is the problem line it is just below the scroll. Quote Link to comment https://forums.phpfreaks.com/topic/71165-solved-i-dont-see-the-error/#findComment-357947 Share on other sites More sharing options...
marcus Posted September 29, 2007 Share Posted September 29, 2007 Just remove the }; Quote Link to comment https://forums.phpfreaks.com/topic/71165-solved-i-dont-see-the-error/#findComment-357949 Share on other sites More sharing options...
BlueSkyIS Posted September 29, 2007 Share Posted September 29, 2007 I copied your code and it runs fine here. but i did have to remove some bad characters first. don't know if they were from the original code or from posting on the forum. This works fine for me, though I hate semi-colons after if, which, other loops. <?php IF(isset($_SESSION['id'])){ ?> <h2>Add a User</h2> <? IF($_POST['create'] == "Add"){ # Form has been submited }ELSE{ # form to create a user. ?> <form action="index.php?mode=adduser" method="POST"> Username:<br> <INPUT type="text" name="name"><br> Password:<br> <INPUT type="password" name="pass"><br> Retype Password:<br> <INPUT type="password" name="cpass"><br> <INPUT type="submit" name="create" value="Add"><br> </form> <?php }; }ELSE{ # <-- this is the problem line echo '<p>You must be logged in to see this</p>'; }; ?> Quote Link to comment https://forums.phpfreaks.com/topic/71165-solved-i-dont-see-the-error/#findComment-357950 Share on other sites More sharing options...
Daleeburg Posted September 29, 2007 Author Share Posted September 29, 2007 no, i found the problem, up in line 5 i needed to put "<?php" not "<?" , my editor thinks i have quick tags, but i dont so the editor wouldn't see that, where as the code block on phpfreaks does not assume quick tags. Quote Link to comment https://forums.phpfreaks.com/topic/71165-solved-i-dont-see-the-error/#findComment-357951 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.