...

View Full Version : processing a password not working



chelvis
02-13-2006, 04:12 PM
I have a page with username and password. When a user enters a wrong username or password or even he enters the correct ones, it is just displaying a blank page. Why is this happening? Is it to do with the code or the server?

Here is the page:
http://chelvisdesign.weezyhost.com/login1.html
username: test
password: test1

Here is the PHP pages that process the code:
test_processlogin.php
<?
session_start();
include("test_membership.php");
$username = trim($_POST['loginname']);
$password = trim($_POST['loginpassword']);
if ($username == getMember() && $password == getPassword())
{
$_SESSION['login'] = 1;
header("Location: test_membersonlypage.php");
exit;
}
else
{
header("Location: test_errorlogin.html");
exit;
}
?>

test_membership.php
<?
function getMember()
{
return "test";
}
function getPassword()
{
return "test1";
}
?>

test_membersonlypage.php
<?
// membersonlypage.php (and other members' only pages)
session_start();
if (!isset($_SESSION['login']))
{
header("Location: test_errorlogin.html");
exit;
}
header("Location:welcome.html");
?>

degsy
02-14-2006, 02:37 PM
The code seems fine. Check your submitted data.

Also use PHP or CODE tags when posting code



This is PHP code

chelvis
02-14-2006, 04:00 PM
degsy, I didnt understand what you meant? "Check your submitted data." Can you explain please?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum