bob plano wrote:
i am very new to php and right now i am trying to make a members only part to my site. the login part of it doesn't work and i have been trying to diplay a mysql error like this: $result = mysqli_query($connection,$sql) or $message= mysql_error(); echo "$message<br>"; die( ); and of course it doesn't work. please point out what i'm doing wrong.
The 'or' method can only take a single statement after it. What PHP 'sees' is this...
$result = mysqli_query($connection,$sql) or $message= mysql_error(); echo "$message<br>"; die( ); ...meaning that it always does the echo and die. What you want is this... $result = mysqli_query($connection,$sql) or die(mysql_error().'<br/>'); Also, I think your use of mysqli_query is not quite correct.
another question is how would i do a password check. like most sites where you login, they have a type password and a retype password box. where would i put this is the form's processor to check the password? i'm sorry that i have to send this to you people, but i need someone more experienced to check this.
I'm not entirely clear what you mean. You generally only have to type the password twice on signup, not at login. Assuming signup is what you meant, you really need to do it twice - once in Javascript on the client when the form is submitted and again in the PHP as soon as possible in the script. There is no point processing the form if that basic requirement has not been met.
Hope that helps. -Stut -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php