Try to write a login interface, has not finished, testing the time to find problems. $_post value will not be emptied, each input user name, $_post inside more than one user name, the consequence is the first error input, you can no longer enter the correct user name ... Unless the browser refreshes the page ...
<title>Welcome back</title>
. error {color:red;}'; if ($_server[' Request_method ']== ' POST ') {$problem = false; $login = False;if (Empty ($_post[' user_name '])) {$problem = True;print '
Please enter your user name!
';} if (Empty ($_post[' password ')) {$problem = True;print '
Please enter a password
';} if (! $problem) {$user = Trim (stripslashes ($_post[' user_name ')), $pwd = Trim (stripslashes ($_post[' password ')); $user = Mysql_real_escape_string ($user); $pwd = mysql_real_escape_string ($pwd); $q = "SELECT * from user WHERE user_name = ' $user ' A nd PASSWORD = ' $pwd ', echo $q; $result = mysql_query ($q); if (! $result | | mysql_num_rows ($result) = = 0) {print '
Wrong Username or Password.
';} else{$row = mysql_fetch_array ($result), $id = $row [' user_id ']; $name = $row [' user_name '];echo ' USER ID is '. $id; session_ Start (); $_session[' $id '] = $id;//clear the POST array$_post = Array (); The way to find it online, but it doesn't seem to use}}else{print '
Please try Again!
';}}? >
Please help the master to solve, grateful
Reply to discussion (solution)
Switch
Can
Is the space in value and carriage return line break in mischief
PHP code?12345678Input Type=text is a single-line text editor
If you give him multiple lines of text, then only the first line can be edited. That's why you're having a problem.
Why is there such a thing???
=================================================
I'm here to study.
Maybe you have a problem with post assignment, the value of post will only overwrite the previous one, how can it be attached?