1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<?
include('connection.php');
include('toutdebut.php');
@$nomTn=$_GET['tn'];
@$page=$_GET['page'];
if((isset($nomTn))&&(isset($page)))
{
$result=mysql_fetch_array(mysql_query('select admin, nom from tournois where nom="'.$nomTn.'"'));
if($result['admin'] != $_SESSION['login'])
{
header('location:redir.php?m=needAdminTn&p=index.php');
exit();
}
$loginTn=$nomTn;
}
else
{
@$loginTn=$_POST['loginTn'];
@$passTn=$_POST['passTn'];
@$page=$_POST['page'];
if((!isset($loginTn))||(!isset($passTn)))
{
header('location:redir.php?m=emptyField&p='.$page);
exit();
}
$sql='select nom, pass from tournois where nom="'.$loginTn.'"';
$req=mysql_query($sql);
$rows=mysql_num_rows($req);
if($rows==0)
{
header('location:redir.php?m=badLoginTn&p='.$page);
exit();
}
$sql='select id, pass from tournois where nom="'.$loginTn.'"';
$req=mysql_query($sql);
$result=mysql_fetch_array($req);
if($passTn != $result['pass'])
{
header('location:redir.php?m=badPass&p='.$page);
exit();
}
}
$_SESSION['tournoi']=$loginTn;
header('location:'.$page);
?> |
Partager