I am creating a function called login, I have a main file called index.php
.. which has my login form , it calls a login.php file, and in that
login.php there is file include statement which calls config.php and that is
where the function lie. This is my function , now if i don't set this as a
function and just put it my login.php it works fine. But when I name the
function in put it in my config.php no matter what I do all ways giving me
the error You have entered an invalid username or password. I dont know if
this has to do with passing of variables.. or what is going on but if
something can please help me I would appreciate it ..

Thank You

  function login() {
$query="Select uname from members where pass='$pass'and uname='$username'";
$result=mysql_query($query) or die("You are not authorized to be here.");
$array= @mysql_fetch_array($result);
$uname = $array[0];
if($uname=="")
{
echo "You have entered an invalid username or password";
}
else

{
echo "You are logged in";
$remote_address = getenv("REMOTE_ADDR");
        echo "Your IP address is $remote_address.";
}
}



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to