Code error help
Posted: Fri May 02, 2008 5:01 pm
Hi guys im new to php and dont know squat in terms of technical stuff.. i have a log in form that looks to have no errors but it keeps coming up with the dredded parse error when testing on the wamp server. I dont have a clue what's wrong so was wondering if anyone can help me..
my code is....
As well as this i need to produce a way so the logged in user can post messages on their page and saves to a database- i have no idea how to go about doing that so any help would be great.
thanks in advance
my code is....
Code: Select all
<?php
session_start();
session_register('valid_login');
session_register('user_id');
session_register('user_name');
?>
<?php
$username = $_GET['username'];
$password = $_GET['password'];
$userfile = fopen("users.txt", "r") or die ("Yikes");
while (!feof($userfile)) {
$line = fgets($userfile);
$items = explode("|", $line);
if (array_key_exists($username,$passwd) && $passwd[$username] == $password)
{
$_SESSION['user_id'] = $uid[$username];
$_SESSION['user_name'] = $username;
$_SESSION['valid_login'] = true;
echo "Welcome <p><a href="private.php">Click here to continue.</a></p>";
exit();
} else {
session_destroy();
}
?>
<html>
<head>
<title>Login Incorrect</title>
</head>thanks in advance