Bonjour,
Je veu construire un peti forum pour mon intranet.Quelqu un a til un petit code qui marche ?
Je souhaite avoir une section administrateur et une section utilisateur.
Voici un code que j essaie mais qui me donne des liens qui ne marche pas...
<?php
echo "<link rel=\"stylesheet\" href=\"forum.css\">";
echo "<body bgcolor=\"#558CAA\">";
if(empty($action))
{
$action=listsujet;
}
###########################
# #
# Forum PHP #
# #
# Copyright © 2001 #
# #
# Lissyx #
# #
###########################
$db = mysql_connect("localhost","root","");
mysql_select_db("user_db",$db);
if($action=='listsujet')
{
if(empty($start))
{
$start=0;
}
if(empty($stop))
{
$stop=10;
}
$Subj = mysql_query("SELECT * FROM sujets ORDER By DateHeure Desc LIMIT $start,$stop");
$Ress = mysql_numrows($Subj);
if($Ress!='0')
{
?>
<center>
<table bgcolor="#5263de" border="0" width="80%" cellpadding="4" cellspacing="0" style="border-width:1; border-top-color:white; border-right-color:black; border-bottom-color:black; border-left-color:white; border-style:solid;">
<tr>
<td width="85%" style="border-width:1; border-top-color:white; border-right-color:black; border-bottom-color:black; border-left-color:white; border-style:solid;">
<font size="5" color="#FFFF00"><center>Liste des sujets de discussion (<?php echo $Ress; ?>)</center></font>
</td>
<td width="15%" style="border-width:1; border-top-color:white; border-right-color:black; border-bottom-color:black; border-left-color:white; border-style:solid;">
<center>
<font color="#FFFF00">
Nombre de réponse(s) au sujet
</font>
</center>
</td>
</tr>
<?php
$i=0;
WHILE($Ress!=$i)
{
$Sujet = mysql_result($Subj,$i,"NomSujet");
$RecupNbrMsg = mysql_query("SELECT * FROM `".$Sujet."`");
$NbrMsg = mysql_numrows($RecupNbrMsg);
if($NbrMsg!='0')
{
$NbrMsg=$NbrMsg-1;
}
if($NbrMsg=='0')
{
$NbrMsg=$NbrMsg;
}
?>
<tr>
<td bgcolor="#DEDFDF" width="85%" style="border-width:1; border-top-color:white; border-right-color:black; border-bottom-color:black; border-left-color:white; border-style:solid;">
<b><a href="?action=voir&KelSujet=<?php echo $Sujet;?>"><?php echo $Sujet;?></a></b>
</td>
<td width="15%" style="border-width:1; border-top-color:white; border-right-color:black; border-bottom-color:black; border-left-color:white; border-style:solid;">
<center>
<font color="#FFFF00">
<?php echo $NbrMsg; ?>
</font>
</center>
</td>
</tr>
<?php
$i=$i+1;
}
echo "</table>";
$i=0;
$Page=1;
$APage=$stop/10;
echo "<p align=\"center\"><font color=\"FFFF00\">Navigation : ";
WHILE($Ress > $i)
{
$i2=$i+10;
$i3=$i2/10;
if($i3 == $APage)
{
echo $Page." ";
}
elseif($i3 != $APage)
{
echo "<a href=\"?action=listsujet&start=$i&stop=$i2\">$Page</a> ";
}
$Page=$Page+1;
$i=$i+10;
}
echo "</p>";
echo "[ <a href=\"?action=formajoutsubj\">Nouveau Sujet</a> - <a href=\"forum.php?action=form_inscription\">Inscription</a> - <a href=\"?action=admin\">Administration</a> ]";
echo "</center></font>";
}
else
{
echo "<a href=\"?action=formajoutsubj\">Nouveau Sujet</a> - <a href=\"forum.php?action=form_inscription\">Inscription</a></center></font> - <a href=\"?action=admin\">Administration</a> ]";
}
}
if($action=='voir')
{
if(empty($start))
{
$start=0;
}
if(empty($stop))
{
$stop=15;
}
$Aff = mysql_query("SELECT * FROM `$KelSujet` LIMIT $start,$stop");
$Res = mysql_numrows($Aff);
$i=0;
WHILE($Res!=$i)
{
$Nom = mysql_result($Aff,$i,"Nom");
$Mail = mysql_result($Aff,$i,"Email");
$Titre = mysql_result($Aff,$i,"Titre");
$D = mysql_result($Aff,$i,"Date");
$H = mysql_result($Aff,$i,"Heure");
$Message = mysql_result($Aff,$i,"Message");
$Message = str_replace( "/\r\n|\n\r|\n|\r/", "<br>",$Message);
?>
<center>
<table width="70%" border="0" bordercolor="#5263de" cellspacing="0" cellpadding="4">
<tr bgcolor="#5263de">
<td valign="middle" width="15%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<font SIZE="1" face="Verdana, Arial, Helvetica" color="#ffffff"><b>Auteur</b></font>
</td>
<td valign="middle" width="85%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<font SIZE="1" face="Verdana, Arial, Helvetica" color="#ffffff"><b>Sujet: <?php echo $Titre; ?></b></font>
</td>
</tr>
<tr bgcolor="#dedfdf">
<td width="15%" valign="top" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<font color="#000000">
<a href="mailto:<?php echo $Mail;?>" title="Envoyer un email à <?php echo $Nom; ?>"><?php echo $Nom; ?></a>
</font>
</td>
<td width="85%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<font SIZE="2" FACE="Verdana, Arial, Helvetica"><font SIZE="1" color="#5263de" face="Verdana, Arial, Helvetica">Envoyé le <?php echo $D." ".$H ;?></font></font><hr>
<font color="#000000">
<?php echo $Message; ?>
</font>
</td>
</tr>
</table>
</center>
<?php
$i=$i+1;
}
$i=0;
$Page=1;
$APage=$stop/15;
echo "<p align=\"center\"><font color=\"FFFF00\">Navigation : ";
WHILE($Res > $i)
{
$i2=$i+15;
$i3=$i2/15;
if($i3 == $APage)
{
echo $Page." ";
}
elseif($i3 != $APage)
{
echo "<a href=\"?action=listsujet&start=$i&stop=$i2\">$Page</a> ";
}
$Page=$Page+1;
$i=$i+15;
}
echo "</p></font>";
echo "<center><font color=\"#FFFF00\">[ <a href=\"?action=formajoutrep&Sujet=$KelSujet\">Répondre</a> | <a href=\"?action=listsujet\">Retour à la liste des sujets</a> ]</font></center>\n";
}
if($action=='formajoutrep')
{
?>
<body bgcolor="#558CAA" text="black" link="black" vlink="black" alink="black">
<center>
<form name="Forum" action="forum.php" method="POST">
<table border="0" width="50%" cellspacing="0" cellpadding="4" bgcolor="#DEDFDF" bordercolor="#5263DE" bordercolordark="#5263DE" bordercolorlight="#5263DE">
<tr>
<td bgcolor="#5263DE" width="100%" colspan="2" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="center"><font color="white"><b>Ajout d'une réponse
au sujet '<?php echo $Sujet;?>'<br>Pour
poster sur le forum, vous devez être inscrit ! </b></font><a href="?action=form_inscription" target="NewFrame"><b><font color="white">cliquez
ici</font></b></a><font color="white"><b> pour vous inscrire ! </b></font></p>
</td>
</tr>
<tr>
<td width="30%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">Nom : </p>
</td>
<td width="70%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="left"><input type="text" name="Nom" size="35"></p>
</td>
</tr>
<tr>
<td width="30%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">Mot de passe :</p>
</td>
<td width="70%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="left"><input type="password" name="pass"></p>
</td>
</tr>
<tr>
<td width="30%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">E-Mail : </p>
</td>
<td width="70%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;"> <p align="left"><input type="text" name="Email" size="35"></p>
</td>
</tr>
<tr>
<td width="30%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">Titre du message : </p>
</td>
<td width="70%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="left"><input type="text" name="Titre" size="53"></p>
</td>
</tr>
<tr>
<td width="30%" valign="top" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">Message : </p>
</td>
<td width="70%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="left"><textarea name="Message" rows="15" cols="36"></textarea></p>
</td>
</tr>
</table>
<input type="hidden" name="action" value="ajoutrep">
<input type="hidden" name="Sujet" value="<?php echo $Sujet; ?>">
</center>
<p align="center"><input type="submit" name="Ajout" value="Ajouter"></p>
</form>
<?php
}
if($action=='formajoutsubj')
{
?>
<link rel="stylesheet" href="forum.css">
<body bgcolor="#558CAA" text="black" link="black" vlink="black" alink="black">
<center>
<form name="Forum" action="forum.php" method="POST">
<table border="0" width="50%" cellpadding="4" cellspacing="0" bgcolor="#DEDFDF" bordercolor="#5263DE" bordercolordark="#5263DE" bordercolorlight="#5263DE">
<tr>
<td bgcolor="#5263de" width="536" colspan="2" bordercolor="#5263DE" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="center"><font color="white"><b> Ajout d'un
nouveau sujet de discussion sur le forum<br>Pour poster
sur le forum, vous devez être inscrit ! </b></font><a href="?action=form_inscription" target="NewFrame"><b><font color="white">cliquez
ici</font></b></a><font color="white"><b> pour vous inscrire
!</b></font></p>
</td>
</tr>
<tr>
<td width="30%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">Nom : </p>
</td>
<td width="70%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="left"><input type="text" name="Nom" size="35"></p>
</td>
</tr>
<tr>
<td width="30%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">Mot de passe :</p>
</td>
<td width="70%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="left"><input type="password" name="pass"></p>
</td>
</tr>
<tr>
<td width="30%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">Sujet : </p>
</td>
<td width="70%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="left"><input type="text" name="NewSubj" size="35"></p>
</td>
</tr>
<tr>
<td width="30%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">E-mail : </p>
</td>
<td width="70%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="left"><input type="text" name="Email" size="35"></p>
</td>
</tr>
<tr>
<td width="30%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">Titre du message : </p>
</td>
<td width="70%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="left"><input type="text" name="Titre" size="53"></p>
</td>
</tr>
<tr>
<td width="30%" valign="top" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right"> Message : </p>
</td>
<td width="70%" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="left"><textarea name="Message" rows="15" cols="36"></textarea></p>
</td>
</tr>
</table>
<input type="hidden" name="action" value="ajoutsubj">
</center>
<p align="center"><input type="submit" name="Ajout" value="Ajouter"></p>
</form>
<?php
}
if($action=='ajoutrep')
{
$user = $Nom;
$Usr = mysql_query("SELECT * FROM `Usr` WHERE utilisateur LIKE '$user' LIMIT 0,1");
$Res = mysql_numrows($Usr);
if($Res=='0')
{
echo "Utilisateur inconnu!";
mysql_close();
}
$i=0;
while($Res!=$i)
{
$Utilisateur = mysql_result($Usr,$i,"utilisateur");
$MDP = mysql_result($Usr,$i,"mdp");
if($Utilisateur==$user)
{
if($MDP==$pass)
{
$Date = date("d-m-Y");
$Heure = date("H:i");
$Req = mysql_query("INSERT INTO `$Sujet` (`Nom`, `Email`, `Titre`, `Message`, `Date`, `Heure`) VALUES ('$Nom', '$Email', '$Titre', '$Message', '$Date', '$Heure')");
if($Req=='true')
{
echo "<center>\n";
echo "Message ajouté...<br>\n";
echo "</center>\n";
echo "<script>{location.href=\"?action=voir&KelSujet=$Sujet\"}</script>";
}
}
}
if($MDP!=$pass)
{
echo "<font color=\"#FFFF00\"><center>Mot de passe incorrect!</center></font>";
}
if($Utilisateur!=$user)
{
echo "<font color=\"#FFFF00\"><center>Utilisateur inconnu! respectez la différence MAJUSCULES/minuscules!</center></font>";
echo "<center><a href=\"javascript:history.back(-1)\">Retour</a></center>";
}
$i=$i+1;
}
}
if($action=='ajoutsubj')
{
$user = $Nom;
$Usr = mysql_query("SELECT * FROM `Usr` WHERE utilisateur LIKE '$user' LIMIT 0,1");
$Res = mysql_numrows($Usr);
if($Res=='0')
{
echo "Utilisateur inconnu!";
mysql_close();
}
$i=0;
while($Res!=$i)
{
$Utilisateur = mysql_result($Usr,$i,"utilisateur");
$MDP = mysql_result($Usr,$i,"mdp");
if($Utilisateur==$user)
{
if($MDP==$pass)
{
$Date = date("d-m-Y");
$Heure = date("H:i");
$DateHeure = $Date." - ".$Heure;
$AddSubj = mysql_query("INSERT INTO `sujets` (`NomSujet`, `DateHeure`) VALUES ('$NewSubj', '$DateHeure')");
$AddTable = mysql_query("CREATE TABLE `$NewSubj` (`Nom` longtext NOT NULL,`Email` longtext NOT NULL,`Titre` longtext NOT NULL,`Message` longtext NOT NULL,`Date` varchar(10) NOT NULL default '',`Heure` varchar(8) NOT NULL default '') TYPE=MyISAM;");
if($AddTable=='true')
{
$Date = date("d-m-Y");
$Heure = date("H:i");
$FinalAdd = mysql_query("INSERT INTO `$NewSubj` (`Nom`, `Email`, `Titre`, `Message`, `Date`, `Heure`) VALUES ('$Nom', '$Email', '$Titre', '$Message', '$Date', '$Heure')");
if($FinalAdd=='true')
{
echo "<center>";
echo "Ajout effectué!<br>";
}
echo "<a href=\"?action=listsujet\">Liste des sujets de discussion</a>";
echo "</center>";
}
}
}
if($MDP!=$pass)
{
echo "<font color=\"#FFFF00\"><center>Mot de passe incorrect!</center></font>";
}
if($Utilisateur!=$user)
{
echo "<font color=\"#FFFF00\"><center>Utilisateur inconnu! respectez la différence MAJUSCULES/minuscules!</center></font>";
echo "<center><a href=\"javascript:history.back(-1)\">Retour</a></center>";
}
$i=$i+1;
}
}
if($action=='form_inscription')
{
?>
<body bgcolor="#558CAA">
<center>
<form name="InscriptionForum" action="forum.php" method="POST">
<table width="60%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="50" colspan="2" bgcolor="#5263DE" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="center"><font color="white"><b>Inscription sur le forum
de Lissyx Overclocking !</b></font></p>
</td>
</tr>
<tr>
<td width="50%" height="35" bgcolor="#DEDEDF" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">Choisissez votre pseudonyme : </p>
</td>
<td width="50%" height="35" bgcolor="#DEDEDF" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p> <input type="text" name="User" size="27"></p>
</td>
</tr>
<tr>
<td width="50%" height="35" bgcolor="#DEDEDF" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="right">Choisissez votre mot de passe : </p>
</td>
<td width="50%" height="35" bgcolor="#DEDEDF" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p> <input type="text" name="Mdp" size="27"></p>
</td>
</tr>
<tr>
<td width="736" colspan="2" bgcolor="#DEDEDF" style="border-width:1; border-color:rgb(82,99,222); border-style:solid;">
<p align="center"> </p>
<input type="hidden" name="action" value="AddToDataBase">
<p align="center"><input type="submit" name="Valid" value="Inscription !"></p>
<p align="center"> </p>
</td>
</tr>
</table>
</form>
</center>
<?php
}
if($action=='AddToDataBase')
{
$Verif = mysql_query("SELECT * FROM `Usr` WHERE utilisateur LIKE '$User'");
$NbrPseudo = mysql_numrows($Verif);
if($NbrPseudo > 0)
{
echo "<body bgcolor=\"#558CAA\" text=\"#FFFF00\">";
echo "<center>";
echo "Enregistrement impossible !<br>Le pseudonyme choisi est déjà utilisé !!";
echo "<br><font color=\"#FFFF00\"><a href=\"javascript:history.back(-1)\">Choisir un autre pseudonyme</a></font>";
echo "<br><font color=\"#FFFF00\"><a href=\"javascript:close()\">Fermer la fenêtre</a></font>";
echo "</center>";
exit;
}
if($NbrPseudo <= 0)
{
$Add = mysql_query("INSERT INTO `Usr` (`utilisateur`, `mdp`) VALUES ('$User', '$Mdp')");
if($Add=='true')
{
echo "<body bgcolor=\"#558CAA\" text=\"#FFFF00\">";
echo "<center>";
echo "Vous vous êtes enregistré avec les paramètres suivants :<br>";
echo "Nom d'utilisateur : ".$User."<br>";
echo "Mot de passe : ".$Mdp."<br>";
echo "Ne perdez pas ces informations !";
echo "<br><font color=\"#FFFF00\"><a href=\"javascript:close()\">Fermer la fenêtre</a></font>";
echo "</center>";
}
elseif($Add=='false')
{
echo "<center>Ajout de l'utilisateur non effectué! Veuillez réessayer!</center>";
}
}
}
if($action == 'admin')
{
if(empty($zone) && $FromLogOn != true)
{
$zone = sommaire;
}
if($zone == sommaire)
{
?>
<center>
<font color="#FFFF00" face="Verdana" size="6"><p>Section Administration du forum </p></font>
</center>
<center>
<table width="80%">
<tr>
<td width="100%" valign="middle">
<p align="center">
<font color="#FFFF00">
<form name="LogOn Admin" action="forum.php" method="POST">
<p>Nom d'utilisateur : <input type="text" name="Login"></p>
<p>Mot de passe : <input type="password" name="Pass"></p>
<input type="hidden" name="action" value="admin">
<input type="hidden" name="zone" value="logon">
<input type="submit" name="ValidLogIn" value="S'indentifier">
</form>
</font>
</p>
</td>
</tr>
<tr>
<td width="100%" align="center">
<font color="#800000"><b><?php echo $Msg ; ?></b></font>
</td>
</tr>
</table>
</center>
<?php
}
if($zone == 'logon')
{
if($Login != '')
{
if($Login == 'LOGIN')
{
if($Pass == 'MOTDEPASSE')
{
$action = admin;
$zone = choix;
$FromLogOn = true;
$AlReadyLoaded = non;
include("forum.php");
}
}
if($Login != 'LOGIN' || $Pass != 'MOTDEPASSE')
{
$action = admin;
$zone = sommaire;
$Login = '';
$Msg = "Nom d'utilisateur/mot de passe inconnu!";
$FromLogOn = false;
include("forum.php");
}
}
}
if($zone == 'choix' && $FromLogOn = true && $AlReadyLoaded == 'non')
{
$AlReadyLoaded = oui;
?>
<center>
<font color="#FFFF00" face="Verdana" size="6"><p>Section Administration du forum </p></font>
<table width="80%>
<tr>
<td width="50%" align="center"> <form name="GoTo_Zone_General" action="forum.php" method="POST">
<input type="hidden" name="zone" value="general">
<input type="hidden" name="action" value="admin">
<input type="submit" name="Goto_Zone_General" value="Administrer les sujets du forum">
</form>
</td>
<td width="50%" align="center">
<form name="GoTo_Zone_DelUser" action="forum.php" method="POST">
<input type="hidden" name="zone" value="DelUser">
<input type="hidden" name="action" value="admin">
<input type="submit" name="Goto_Zone_DelUser" value="Administrer les utilisateurs du forum">
</form>
</td>
</tr>
</table>
<?php
}
if($zone == 'general')
{
if(empty($start))
{
$start = 0;
}
if(empty($stop))
{
$stop = 10;
}
$Subj = mysql_query("SELECT * FROM `sujets` ORDER By DateHeure Desc LIMIT $start,$stop");
$Ress = mysql_numrows($Subj);
?>
<center>
<font color="#FFFF00" face="Verdana" size="6"><p>Section Administration du forum </p></font>
<table width="80%">
<tr>
<td witdh="85%" align="left">
<font color="#FFFF00" face="Verdana">Titre du sujet</font>
</td>
</tr>
<?php
if($Ress!='0')
{
$i=0;
WHILE($Ress!=$i)
{
$Sujet = mysql_result($Subj,$i,"NomSujet");
?>
<tr>
<td width="85%">
<a href="?action=voir&KelSujet=<?php echo $Sujet ; ?>" target="NewFrame"><?php echo $Sujet ;?></a>
</td>
<td width="15%">
<form name="DelSubj:<?php echo $Sujet ;?>" action="forum.php" method="POST">
<input type="submit" name="Suppr" value="Supprimer le sujet">
<input type="hidden" name="action" value="admin">
<input type="hidden" name="zone" value="DelSubj">
<input type="hidden" name="Sujet" value="<?php echo $Sujet ;?>">
</form>
</td>
<?php
$i++;
}
?>
</tr>
</table>
<?php
$i=0;
$Page=1;
$APage=$stop/10;
echo "<p align=\"center\"><font color=\"FFFF00\">Navigation : ";
WHILE($Ress > $i)
{
$i2=$i+10;
$i3=$i2/10;
if($i3 == $APage)
{
echo $Page." ";
}
elseif($i3 != $APage)
{
echo "<a href=\"?action=admin&zone=general&start=$i&stop=$i2\">$Page</a> ";
}
$Page=$Page+1;
$i=$i+10;
}
echo "</p></font>";
}
}
if($zone == 'DelSubj')
{
if($ConfirmDel != 'true')
{
$RecupDateHeure = mysql_query("SELECT * FROM sujets WHERE `NomSujet` LIKE '$Sujet'");
$ResDateHeure = mysql_numrows($RecupDateHeure);
$DateHeure = mysql_result($RecupDateHeure,$i,"DateHeure");
?>
<center>
<font color="#FFFF00" face="Verdana" size="6"><p>Section Administration du forum </p></font>
Êtes vous sûr de vouloir supprimer le sujet nommé '<?php echo $Sujet ;?>' ?
<form name="ConfirmDel" action="forum.php" method="POST">
<input type="hidden" name="Sujet" value="<?php echo $Sujet ;?>">
<input type="hidden" name="ConfirmDel" value="true">
<input type="hidden" name="action" value="admin">
<input type="hidden" name="zone" value="DelSubj">
<input type="hidden" name="DateHeure" value="<?php echo $DateHeure ;?>">
<p> </p>
<input type="submit" name="ValidSuppr" value="Oui je décide de supprimmer le sujet '<?php echo $Sujet ;?>'">
</form>
</center>
<?php
}
if($ConfirmDel == 'true')
{
$Del = mysql_query("DELETE FROM sujets WHERE `NomSujet`='$Sujet' AND `DateHeure`='$DateHeure'");
$DelTable = mysql_query("DROP TABLE `$Sujet`");
if($Del == '1')
{
echo "<cenetr>Le sujet '$Sujet' a été supprimé avec succès !<br>";
echo "<a href=\"?action=admin&zone=choix&FromLogOn=true&AlReadyLoaded=non\">Retour à d'administration du forum</a></center>";
}
if($Del == '0')
{
echo "<center>Erreur!<br>";
echo "<a href=\"javascript:history.back(-1)\">Retour</a></center>";
}
}
}
if($zone == 'DelUser')
{
if($DoSuppr != 'true')
{
if(empty($start))
{
$start = 0;
$stop = 30;
}
$ReqListUsr = mysql_query("SELECT * From `Usr` LIMIT $start,$stop");
$ResListUsr = mysql_numrows($ReqListUsr);
$Ress = $ResListUsr;
?>
<center>
<font color="#FFFF00" face="Verdana" size="6"><p>Section Administration du forum </p></font>
<font color="#FFFF00">
<table width="60%">
<?php
$i=0;
while($ResListUsr > $i)
{
$User = mysql_result($ReqListUsr,$i,"utilisateur");
$Mdp = mysql_result($ReqListUsr,$i,"mdp");
?>
<tr>
<td width="50%" valign="middle">
<center><font color="#FFFF00"><?php echo $User ;?></font></center>
</td>
<td width="50%">
<p align="center">
<form name="DelUser" action="forum.php" method="POST">
<input type="hidden" name="action" value="admin">
<input type="hidden" name="zone" value="DelUser">
<input type="hidden" name="DoSuppr" value="true">
<input type="hidden" name="User" value="<?php echo $User; ?>">
<input type="submit" name="ValidDel" value="Supprimer">
</form>
</p>
</td>
<?php
$i++;
}
?>
</tr>
</table>
</font>
</center>
<br>
<?php
$i=0;
$Page=1;
$APage=$stop/30;
echo "<p align=\"center\"><font color=\"FFFF00\">Navigation : ";
WHILE($Ress > $i)
{
$i2=$i+30;
$i3=$i2/30;
if($i3 == $APage)
{
echo $Page." ";
}
elseif($i3 != $APage)
{
echo "<a href=\"?action=admin&zone=DelUser&start=$i&stop=$i2\">$Page</a> ";
}
$Page=$Page+1;
$i=$i+30;
}
echo "</p></font>";
}
if($DoSuppr == 'true')
{
$GetMDP = mysql_query("SELECT * FROM `Usr` WHERE `utilisateur` = '$User' LIMIT 0,1");
$ResGetMDP = mysql_numrows($GetMDP);
$UserToDel = $User;
$i=0;
while($ResGetMDP > $i)
{
$MdpToDel = mysql_result($GetMDP,$i,"mdp");
$i++;
}
$Del = mysql_query("DELETE FROM `Usr` WHERE `utilisateur` = '$UserToDel' AND `mdp` = '$MdpToDel'");
if($Del == '1')
{
echo "<center>Utilisateur '$UserToDel' supprimé !<br>";
echo "<a href=\"?action=admin&zone=choix&FromLogOn=true&AlReadyLoaded=non\">Retour au sommaire de l'administration</a></center>";
}
if($Del == '0')
{
echo "<center>Erreur !<br>";
echo "<a href=\"javascript:history.back(-1)\">Retour</a></center>";
}
}
}
}
?>
Merci
Afficher la suite