Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Hide password

General discussions related to php

Moderators: macek, egami, gesf

Hide password

Postby superman » Mon Jul 07, 2003 7:52 am

How 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>";
}
}
?>
superman
New php-forum User
New php-forum User
 
Posts: 36
Joined: Fri Jun 27, 2003 11:54 pm

Postby liquedus » Mon Jul 07, 2003 8:56 am

hide the username and password inside session variables. :wink:
liquedus
php-forum Active User
php-forum Active User
 
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada

Postby bezmond » Mon Jul 07, 2003 9:40 am

or use some form of encryption.

Andrew
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

Postby frogrocker » Mon Jul 07, 2003 10:43 pm

Can't you just use the post method for your form instead of the get, or am I missing something obvious??
User avatar
frogrocker
New php-forum User
New php-forum User
 
Posts: 98
Joined: Mon Jul 07, 2003 10:30 pm
Location: Manchester

Postby bezmond » Tue Jul 08, 2003 5:24 am

that'd work to *g*
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK


Return to PHP General

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.