[SOLVED]Need help on script
Posted: Mon Dec 22, 2003 2:48 pm
I have this in a file called index.php:
it's more than that, but there are no errors after "echo_header();" & "echo_login();".
the "cfg.php"-file contains this:
Now to the problem;
I get " Parse error: parse error, unexpected '}' in C:\xampp\htdocs\notes\cfg.php on line 56", and also "Fatal error: Call to undefined function: echo_header() in C:\xampp\htdocs\notes\index.php on line 9".
I've checked both files many times, but i can't find anything wrong, also, i don't know why i get "unexpected }" in cfg.php.
Anyone?
Code: Select all
<?php
require("cfg.php"); //Include important stuff
if ( empty($_POST['password']) and empty($_SESSION['password']) ) { //DEFAULT
$_SESSION['pass'] = "login";
echo_header();
echo_login();
echo $footer;
} elseif ($_POST['password'] == $pass1word) { //PASSWORD MATCHES
$_SESSION['pass'] = "ok";
echo_header("<META HTTP-EQUIV="refresh" content="3;URL=notes.php"> ");
?>the "cfg.php"-file contains this:
Code: Select all
<?php
session_start(); //Start session
//Password
$pass1word = "test";
//Notes-file
$filename = "vigge89.txt";
//FOOTER
$footer = <<<EOF
</table>
</BODY>
</HTML>
EOF; //END of footer
function echo_header($head) { //Function echo_header
//HEADER
echo <<<EOF
<HTML>
<HEAD>
<title>vigge89's notes</title>
<link rel="stylesheet" href="notes.css">
$head
</HEAD>
<BODY>
<table border="1" align="center" border="0" cellspacing="0">
<tr height="20">
<td class="title">@ vigge89.txt - notepad</td>
</tr>
EOF; //END of header
} //Function echo_header
function echo_login() { //Function echo_login
echo <<<EOF
<tr>
<td colspan="2">
<form name="password" action="index.php" method="post">
Password: <input type="password" name="password">
</td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" value="[ login ]">
</tr>
EOF;
} //Function echo_login
?>Now to the problem;
I get " Parse error: parse error, unexpected '}' in C:\xampp\htdocs\notes\cfg.php on line 56", and also "Fatal error: Call to undefined function: echo_header() in C:\xampp\htdocs\notes\index.php on line 9".
I've checked both files many times, but i can't find anything wrong, also, i don't know why i get "unexpected }" in cfg.php.
Anyone?