Re: Password Protection
| From: | elias | Date: | Thu, 19 Jul 2001 21:25:24 +0000 |
| Subject: | Re: Password Protection | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-8392@lists.php.net to get a copy of this message | ||
try like that:
<?
$result = mysql_query("SELECT password FROM newsauthors WHERE author='$name'
AND password='$code'");
if (mysql_num_rows($result) == 0)
{
// sorry wrong password
} else { // correct pwd }
"Nintendoodle" <mark@nintendoodle.com> wrote in message
news:002701c10ff5$bb273e80$028a7dc2@integral.dom...
I am trying to get a content management system up and running on my site. I
want to have the thing password protected, and this was how I was going
about it, passing on name and password variables in the urls of the
management system. However, this doesnt work, it just says your password in
correct, even when it is not.
Any help ?
<?php
$code = mysql_query("SELECT password FROM newsauthors WHERE $name =
author");
?>
<?php
if ($code = $password) {
?>
//Content manager stuff goes here
<?
} else {
echo( "You have entered an incorrect password, or you do not have access to
this part of the Staff area. Please press back on your browser and re-enter
details." );
}
?>
Thanks in advance