Jump to content

[SOLVED] I dont see the error


Daleeburg

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/71165-solved-i-dont-see-the-error/
Share on other sites

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>';
};
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.