ej guys… strange thing… i made myself a login script with a setcookie… but somehow there is a strange error…
i test this script on my own php server it works fine… but if i upload it to the webserver its suppose to go on, there is an error… and i just cant seem to find what it is… ???
index.php:
<?
include "login_config.php";
if(isset($_POST)){
foreach($_POST as $key => $val){
$$key = $val;
}
}
if(isset($submit) && $submit != ""){
if ($name == $corr_name && $pass == $corr_pass ) {
setcookie('login', $value, time()+900); //* 15min (900sec) *//
header("Location: $pagina");
} else {
echo "Eerst inloggen A.U.B of voer de goede gegevens in....";
exit;
}
}
?>
<form method="post" action="<?=$_SERVER['PHP_SELF'];?>">
<center><font class="atentie_tekst">(Administrators hebben allen toegang hier..)</font></center>
<table border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td>Login:<br><INPUT TYPE="name" SIZE="15" NAME="name"><br></td>
<td>Paswoord:<BR><INPUT NAME="pass" TYPE="password" SIZE="15"><br></td>
</tr>
<tr>
<td><INPUT TYPE="submit" NAME="submit" VALUE="Login"> <input type="reset" name="submit" value="Herstel"></td></td>
</tr>
</table>
</form>
login_config.php:
<?
$corr_name = "test";
$corr_pass = "test";
$pagina = "inhoud_pagina.php";
$value = 'true';
?>
inhoud_pagina.php
<?php
include "login_config.php";
if ($_COOKIE['login'] == true){
?>
hallo
<?
} else {
echo "<script LANGUAGE='javascript' TYPE='text/javascript'>window.location='$pagina'</script>";
}
?>
Error mssg:
Notice: Undefined index: login in …inhoud_pagina.php on line 5 (keep kliking (looping))…
kan anyone help me… ???