Re: Login displays the pass and user in url

From: Date: Mon, 25 Mar 2002 17:50:47 +0000
Subject: Re: Login displays the pass and user in url
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-90067@lists.php.net to get a copy of this message
You have to add an extra tag into the form tag (method="post"), it should read as follows: ("<form name=\"login\" action=\"$PHP_SELF\" method="post"> "David Orn Johannsson" <david@atom.is> wrote in message news:003001c1d418$7126b3f0$6500640a@gandalf... Can I some how prevent the browser from displayin index.php?passwd=pass&user=user in the url when I use this script I wrote. <?php if(!IsSet($stage)){ print("<form name=\"login\" action=\"$PHP_SELF\">"); print("<input type=\"hidden\" name=\"stage\" value=\"1\">"); print("<table>"); print("<tr><td class=\"maintext\"><b>Notendanafn:</b></td><td><input name=\"check_username\" type=\"text\"></td></tr>"); print("<tr><td class=\"maintext\"><b>Lykilorð:</b></td><td><input name=\"check_passwd\" type=\"password\"></td></tr>"); print("<td>&nbsp;</td><td><input type=\"submit\" value=\"Skrá inn\"></td></tr>"); print("</table>"); } else{ include("db_connect.php"); $query = "select id, passwd, system from users where username = '$check_username'"; $mysql_result = mysql_query($query, $db); $row = mysql_fetch_row($mysql_result); if((crypt($check_passwd, 'dominos') == $row[1]) && (($system == 0 || $system == 1 ))){ $sid = session_id(); $uid = $row[0]; print("<a href=\"news.php\">[Fréttir]</a><br>"); print("<a href=\"sms.php\">[SMS - Auglýsingar]</a><br>"); } else if($session == session_id()){ print("<a href=\"news.php\">[Fréttir]</a><br>"); print("<a href=\"sms.php\">[SMS - Auglýsingar]</a><br>"); } else{ print("Þú verður að skrá þig inn. <a href=\"index.php\">[Skrá inn]</a>"); } } ?> <http://www.atom.is/> ------------------------ Davíð Örn Jóhannssson Vefforritari ------------------------ Atómstöðin hf. Garðastræti 37 101 Reykjavík ------------------------ sími: 595-3643 fax: 595-3649 <mailto:david@atom.is> david@atom.is <http://www.atom.is/> http://www.atom.is ------------------------

« previous php.general (#90067) next »