Hei,
I have tried to build a authentication system for my (ISP located) PHP pages(linux,PHP,mysql). I have applied the following code(WIGGEM), but could not get far, because I keep having parse error. My pages where working ok, before I placed these login functions.
Code I am trying:
http://www.zend.com/codex.php?id=561&single=1
Only changes to that I made, was database handling.
I have put the functions login(),testlogin and newuser() into include file named
login_functions.php
My database functions are in db_functions.php and the connection is opened with db_open() function(works ok.)
Then I have start.php file in the start of every php page.
<?php
//start.php
include ("functions.php");
include ("db_functions.php");
include ("login_functions.php");
if (testlogin()) {} else [die("Please log in");]
?>
Then I have istunto.php file that is meant to be login form
//istunto.php
<?php
global $isloggedin;
if ($submit == "submit") {
include("db_functions.php");
include("login_functions.php");
session_start();
session_register('isloggedin');
session_register('username');
session_register('cnt');
db_open();
if (login(tunnus$,$salis)) { die("login ok");} else { print("login failed");}
}
?>
<HEAD>
<TITLE>Login</TITLE>
<link rel="stylesheet" type="text/css" href="style.css">
</HEAD>
<BODY>
<form action="<?php echo $PHP_SELF ?>" method="POST">
<table>
<tr><td class="bigheading">Please log in</td></tr>
<tr><td class="menu2">username: <br><input type="text" name="tunnus"></td></tr>
<tr><td class="menu2">Password: <br><input type="password" name="salis"></td></tr>
<tr><td height="35" valign="bottom"><input class="button" type="submit" name="submit" value="submit"></td></tr>
</table>
</form>
</BODY>
Istunto.php page is not working at all. I keep getting always "parse error" in the line where if block ends }
Anyway, the parse error has been in different lines, when I have tried other order of commands.
Parse error: parse error in /biz/mydomain.fi/html/admin/istunto.php on line 19
And all the other php pages that have start.php include, keep having parse error too (in line:: if (testlogin()) {} else [die("Please log in");])
Parse error: parse error in /biz/mydomain.fi/html/admin/start.php on line 5
Thanks for your advice in advance,
Juha