My authorisation is as below that checks another file for alogin and apassword :
Code: Select all
....
if (!isset($sid)) {
/* Authorisation */
if ($action=="enter") {
if ($login==$dbї"alogin"] && md5($password)==$dbї"apassword"])
{
$sid=md5(time());
Header("Location: ./");
die();
}
}
....Code: Select all
...
$dbї"alogin"]="admin";
$dbї"apassword"]="63a9f0ea7bb98050796b649e85481845";
...it only seems to reload the same page again :blink:
Why does it not go directly to the next page ?
<!-------------------------------------------------------->
Below is a copy of auth.php if you would like to look through
Code: Select all
<?
/**************************************************************/
/* (c) CN-Software CNCat */
/*************************************************************/
error_reporting(E_ALL & ~E_NOTICE);
if (version_compare(phpversion(), "4.2.0", ">=")) $ob=TRUE; else $ob=FALSE;
if ($ob) {ob_start();ob_implicit_flush(0);}
require "../config.php";
require "../lang/".$LANGFILE;
if ($ob) {ob_clean();ob_implicit_flush(1);}
session_register("sid");
if (!isset($sid)) {
/* Authorisation */
if ($action=="enter") {
if ($login==$dbї"alogin"] && md5($password)==$dbї"apassword"]) {
$sid=md5(time());
Header("Location: ./");
die();
}
}
/* Displaying authorisation form */
?>
<HTML>
<HEAD>
<TITLE>CNCat ::: <?=$LANGї"moderators"];?></TITLE>
<STYLE>
<!--
body {font-family:verdana;font-size:11px;}
th {color:white;text-align:left;font-family:verdana;font-size:11px;}
td {font-family:verdana;font-size:11px;}
input,select {font-family:verdana;font-size:11px;}
.t1 {background-color:#EFE5F0;}
.t2 {background-color:#D9C2DC;}
.white {color:white;}
//-->
</STYLE>
</HEAD>
<BODY>
<table cellspacing=0 cellpadding=6 border=0 width=100%><tr><th background='<?=$ADLINK;?>../cat/tablebg.gif'>CNCat ::: <?=$LANGї"moderators"];?></th></tr></table><br>
<table border=0 height=80% width=100%><tr><td>
<table border=0 cellspacing=0 cellpadding=0 align=center width=250>
<tr><th background='<?=$ADLINK;?>../cat/tablebg.gif' colspan=2><a href=http://www.cn-software.com/><img src='<?=$ADLINK;?>../cat/cnlogo.gif' width=31 height=25 border=0></a></th><th background='<?=$ADLINK;?>../cat/tablebg.gif' width=100%><a href=http://www.cn-software.com/><font color=white>CNCat 1.4</font></a></th></tr>
</table>
<table border=0 cellspacing=1 cellpadding=6 align=center width=250>
<form action='<?=$ADLINK;?>index.php' method=post>
<tr class=t1><td>Login:</td><td><input type=text name=login value=''></td></tr>
<tr class=t1><td>Password:</td><td><input type=password name=password value=''></td></tr>
</tr>
<tr><td class=t2 align=right colspan=2><input type=submit value='Enter >>'></th></tr>
<input type=hidden name=action value='enter'>
</form>
</table>
</td></tr></table>
<?
include "_bottom.php";
die();
}
function GetParentName($cid) {
GLOBAL $db;
do {
$r=mysql_query("SELECT name,parent FROM ".$dbї"prefix"]."cat WHERE cid='$cid';");
if (mysql_num_rows($r)==1) {
$name=" ::: ".mysql_result($r,0,0).$name;
$cid=mysql_result($r,0,1);
}
} while (mysql_num_rows($r)==1);
return(substr($name,5,strlen($name)));
}
function sync_names() {
GLOBAL $db;
$r=mysql_query("SELECT cid,name FROM ".$dbї"prefix"]."cat") or die(mysql_error());
while ($a=mysql_fetch_array($r)) {
mysql_query("DELETE FROM ".$dbї"prefix"]."cat_linear WHERE cid='".$aї"cid"]."';") or die(mysql_error());
mysql_query("INSERT INTO ".$dbї"prefix"]."cat_linear SET name='".GetParentName($aї"cid"])."', cid='".$aї"cid"]."';") or die(mysql_error());
}
}
function sync() {
GLOBAL $db;
$R=Array();
mysql_query("UPDATE ".$dbї"prefix"]."cat SET count='0';") or die(mysql_error());
$r=mysql_query("select cat1,count(*) from ".$dbї"prefix"]."main where type=1 and cat1!=0 group by cat1;") or die(mysql_error());
for ($i=0;$i<mysql_num_rows($r);$i++) {
$cid=mysql_result($r,$i,0);
$count=mysql_result($r,$i,1);
if (!isset($Rї$cid])) $Rї$cid]=0;
$Rї$cid]+=$count;
}
while (list($k, $v)=each($R)) {
mysql_query("UPDATE ".$dbї"prefix"]."cat SET count=count+'$v' WHERE cid='$k';") or die(mysql_error());
$id=$k;
do {
$r=mysql_query("SELECT parent FROM ".$dbї"prefix"]."cat WHERE cid='$id';") or die(mysql_error());
$id=mysql_result($r,0,0);
if ($id!=0) {
mysql_query("UPDATE ".$dbї"prefix"]."cat SET count=count+'$v' WHERE cid='$id';") or die(mysql_error());
}
} while ($id!=0);
}
}
?>