dsl je savai pas quil fallai ettre inscrit, je colle le mess ici alors:
oki, tien, je redonne toutes les pages :
le formulaire pour noter et poster l´article : ( form_creat.php3)
--------------------------------------------------
------------------
< ?php
include(´global.php´);
$db->connect();
verif_session();
check_lvl(´admin´);
$db->close();
include("../include/conf_articles.php3");
echo " <html>
< body bgcolor=´#CFE3E3´>
< form method=´POST´
action=´creat_articles.php3?session_id=$session_id
´>
< table border=´0´ cellpadding=´3´ cellspacing=´1´ bgcolor=´#000000´>
< tr>
< td colspan=´2´ bgcolor=´#2D7DA7´><b><center><font face=´Verdana´ color=´#FFFFFF´ size=´4´>Poster un article</font></center></b></td>
< /tr>
< tr>
< td bgcolor=´#2D7DA7´><b><font size=´2´ face=´Verdana´>Titre du test</font></b></td>
< td bgcolor=´#ABD5D5´><font face=´Verdana´><input type=´text´ name=´titre´ size=´40´></font></td>
< /tr>
< tr>
< td bgcolor=´#2D7DA7´><b><font size=´2´ face=´Verdana´>Pseudo</font></b></td>
< td bgcolor=´#ABD5D5´><font face=´Verdana´><input type=´text´ name=´nom´ size=´40´></font></td>
< /tr>
< tr>
< td bgcolor=´#2D7DA7´><b><font size=´2´ face=´Verdana´>Password ( pour modification)</font></b></td>
< td bgcolor=´#ABD5D5´><font face=´Verdana´><!--webbot bot=´Validation´
S-Display-Name=´password´ B-Value-Required=´TRUE´ I-Maximum-Length=´10´
--><input type=´text´ name=´password´ size=´10´ maxlength=´10´></font></td>
< /tr>
< tr>
< td bgcolor=´#2D7DA7´><b><font size=´2´ face=´Verdana´>Votre texte</font></b></td>
< td bgcolor=´#ABD5D5´><font face=´Verdana´><textarea rows=8 name=´texte´ cols=37></textarea></font></td>
< /tr>
< tr>
< td bgcolor=´#2D7DA7´><b><font size=´2´ face=´Verdana´>Votre email</font></b></td>
< td bgcolor=´#ABD5D5´><font face=´Verdana´><input type=´text´ name=´email´ size=´30´></font></td>
< /tr>
< tr>
< td bgcolor=´#2D7DA7´><b><font size=´2´ face=´Verdana´>Note de départ ( avis des lecteurs)</font></b></td>
< td bgcolor=´#ABD5D5´><font face=´Verdana´><input type=´text´ name=´avis´ size=´30´></font></td>
< /tr>
< tr>
< td bgcolor=´#ABD5D5´ colspan=´2´>
< p align=´center´><font face=´Verdana´><input type=´submit´ value=´Ajouter´>
| < input type=´reset´ value=´Recommencer´></font></td>
< /tr>
< /table>
< /form>";
echo"
< p> </p>
< /body>
< /html>";
? >
--------------------------------------------------
------------------------
la page qui crée tout juste apres le formulaire : ( creat_articles.php3)
--------------------------------------------------
--------------
< ?php
include(´global.php´);
$db->connect();
verif_session();
check_lvl(´admin´);
$db->close();
include("../include/conf_articles.php3");
echo " <html><head><title>Création d´un Article : OK</title></head><body bgcolor=´#CFE3E3´>";
if($titre ! = " " && $email ! = " " && $nom ! = " " && $password ! = " " && $texte ! = " ")
{
$id=1;
while
(file_exists("../../gc/tests/articles/test_".$id."
.php3"))
{
if($id == 400)
{
break;
}
$id++;
}
function EmailOK($email)
{
return( ereg(´^[-!#$%&\´*+\\./0-9=?A-Z^_`a-z{|}~]+´.
´@´.
´[-!#$%&\´*+\\/0-9=?A-Z^_`a-z{|}~]+\.´.
´[-!#$%&\´*+\\./0-9=?A-Z^_`a-z{|}~]+$´,
$email) ) ;
}
if(!EmailOK($email))
{
echo " <table border=´0´ cellpadding=´2´ cellspacing=´1´>
< tr>
< td bgcolor=´#2D7DA7´><b><font face=´Verdana´ size=´3´ color=´#FFFFFF´>Erreur
! </font></b></td>
< /tr>
< /table>ATTENTION : L´email n´est pas correcte ! ";
}
else
{
echo " <font face=´Verdana´ size=´3´>
< table border=´0´ cellpadding=´2´ cellspacing=´1´ bgcolor=´#000000´>
< tr>
< td bgcolor=´#2D7DA7´><font face=´Verdana´ size=´3´ color=´#FFFFFF´><b>Article créé!</b></font></td>
< /tr>
< /font>
< tr>
< td bgcolor=´#2D7DA7´><font size=´2´><font face=´Verdana´><br>
< table border=´0´ cellpadding=´2´ cellspacing=´1´ bgcolor=´#000000´>
< tr>
< td bgcolor=´#ABD5D5´><font face=´Verdana´ size=´2´>Numéro ID</font></td>
< td bgcolor=´#ABD5D5´><font face=´Verdana´ size=´2´><b>$id</b></font></td>
< /tr>
< tr>
< td bgcolor=´#ABD5D5´><font face=´Verdana´ size=´2´>Titre</font></td>
< td bgcolor=´#ABD5D5´><font face=´Verdana´ size=´2´><b>$titre</b></font></td>
< /tr>
< tr>
< td bgcolor=´#ABD5D5´><font face=´Verdana´ size=´2´>Mot de passe</font></td>
< td bgcolor=´#ABD5D5´><font face=´Verdana´ size=´2´><b>$password</b></td>
< /tr>
< /table>
< /td>
< /tr></table></font>";
if(@mkdir("articles", 0777))
{
}
$fp2 = fopen("../../gc/tests/articles/notes/noter". $id . ".php", " w");
fwrite($fp2,"<?php
\$fp = fopen(\"notes$id.txt\", \"a+\");
if(!\$fp) die(\"Création du fichier impossible ! \");
\$contenu = \"\$GLOBALS[note] \\n\";
fputs(\$fp, \$contenu);
fclose(\$fp);
\$lignes=file(\"notes$id.txt\");
\$moyenne=array_sum(\$lignes) / count(\$lignes);
? >
< body onload=´window.self.close()´ > ");
fclose($fp2);
$fp = fopen("../../gc/tests/articles/notes/notes". $id . ".txt", " w");
fwrite($fp,"$avis\n");
fclose($fp);
$modif = fopen("../../gc/tests/articles/test_". $id . ".php3","w");
fwrite($modif,"<?\$nom = \"$nom\";\n\$titre = \"$titre\";\n\$nom = \"$nom\";\n\$password = \"$password\";\n\$texte = \"$texte\";\n\$email = \"$email\"; \$date = \"$today\";");
fclose($modif);
}
}
else
{
echo " <table border=´0´ cellpadding=´2´ cellspacing=´1´>
< tr>
< td bgcolor=´#2D7DA7´><b><font face=´Verdana´ size=´3´ color=´#FFFFFF´>Erreur
! </font></b></td>
< /tr>
< /table>ATTENTION : Tous les champs obligatoires n´ont pas été renseignés";
}
? >
--------------------------------------------------
----------------
et enfin, la page qui affiche la liste des articles postés : ( liste_comptes.php3)
< ?php
include(´global.php´);
$db->connect();
verif_session();
check_lvl(´ld´);
include("../include/conf_articles.php3");
$id=1;
echo " <html><body bgcolor=´#CFE3E3´>
< bR><br><font face=´Verdana´ size=´2´>";
while
(!file_exists("../../gc/tests/articles/test_".$id.
".php3"))
{
if($id == 400)
{
break;
}
$id++;
}
while
(file_exists("../../gc/tests/articles/test_".$id."
.php3"))
{
include("../../gc/tests/articles/test_".$id.".php3
");
echo " <table border=´0´ cellspacing=´0´ width=´100%´>
< tr>
< td bgcolor=´#2D7DA7´><b><a
href=´admin_voir.php3?session_id=$session_id&=$i
d´>$titre</a></b> rédigé par $nom<br>";echo " ( <a
href=´modifier_articles.php3?session_id=$session_i
d&=$id´>Modifier</a>)</font></font></td>
< td width=´300´ align=´right´ bgcolor=´#2D7DA7´>Posté le $date</td>
< /tr>
< /table>
< hr>
" ;
$id++;
while
(!file_exists("../../gc/tests/articles/test_".$id.
".php3"))
{
if($id == 400)
{
break;
}
$id++;
}
$ok=1;
}
echo " </font></body></html>";
if($ok ! = 1)
{
echo " <html><body bgcolor=´#CFE3E3´><font face=´Verdana´ size=´2´><b>Désolé :</b> Aucun article a afficher actuellement...</font>";echo"</body></html>";
}
else
{
echo " ";
}
? >
--------------------------------------------------
-------------
--------------------------------------------------
-------------
--------------------------------------------------
-------------
voila et pour reresumer, je voudrai que les articles postés ce classe par ordre alphabetique, et avec une presentation un peu comme jeuxvideo.com ( la ou il y a les tests)
voila bye! et bonne chance!