![]() |
|
#1
|
|||
|
|||
Hide passwordHow to hide the password that display in the address bar? Every time I login, it will show the username and password, it's OK to show the username but not password. The problem is 'http://localhost/verify1.php?username=manager&password=manager'. Thank you.
<?php setcookie("username"); ?> <? setcookie("username", $username); if ($username ==NULL && $password ==NULL) { echo"<br><br><br><font size = 4 color = #003366><center>Please Try Again!!!<br><br><br>"; echo"NO Username & Password<br><br><br>"; echo "Click <a href=\"login1.php\">here</a> to try again !!<br>"; } else { $Connect = mysql_connect("localhost","root",""); mysql_select_db("mw"); $check == 0; $result=mysql_query("select * from account1"); $number_of_rows = mysql_num_rows($result); $i=0; $check=0; while ($number_of_rows != 0) { $row = mysql_fetch_row($result); $number_of_rows--; if ($username==$row[0] && $password==$row[1]) { echo"<br><br><br><font size = 4 color = #003366><center>Congratulations !!<br><br>"; echo "Hello!! <b>$username</b><br><br>"; echo"You had access HELP INSTITUTE website<br><br><br>"; echo "Click <a href=\"welcome1.php\">here</a> to CONTINUE !!<br>"; $check=1; break; } } if ($check == 0) { echo"<br><br><br><font size = 4 color = #003366><center>Please Try Again!!!<br><br><br>"; echo"Wrong Username OR Password<br><br><br>"; echo "Click <a href=\"login1.php\">here</a> to try again !!<br>"; } } ?> |
|
#2
|
|||
|
|||
|
The problem is with the form that you send the username & password from.
It's sending the info using the GET method, which sticks the names & values of the form components onto the end of the query string. If you change the FORM tag, so that it has method="post" in it, then the form's info will be send using POST, where the info is hidden from view - it doesn't show up in the query string. Coding Tips: To see if a variable has been set, don't see if it's NULL, use the isset() function. So PHP Code:
Garth Farley |
|
#3
|
||||
|
||||
|
Hmm, I'm NOT going to re-write that code, that will be the best for all, btw
if you are running PHP 4.1.0 or higher you should use PHP Code:
|
Recent GIDBlog
Toyota - 2008 August Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP sessions problem | andy | MySQL / PHP Forum | 19 | 18-Jan-2007 11:34 |
| Creating a search engine friendly forum | BobbyDouglas | Search Engine Optimization Forum | 14 | 20-Nov-2003 16:31 |
| Password Script Help | BobbyDouglas | MySQL / PHP Forum | 26 | 12-Aug-2003 18:26 |
| webpage password | robynhood | Web Design Forum | 3 | 11-May-2003 21:23 |
| Password Protect using Frontpage 2000 | Lynx | Web Design Forum | 3 | 04-Jul-2002 19:14 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The