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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
| <?php
require_once("../inc/conf.inc.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd" />
<HTML>
<HEAD>
<TITLE>Ajout d'une Fan Fiction</TITLE>
<META NAME="author" content="Fistsab" />
<META NAME="version" content="3.8.1" />
<META HTTP-EQUIV="Content-Type" CONTENT="text/html";
charset=iso-8859-1 />
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css" />
<META NAME="keywords" content="Fan fic, fic, kotor, kotor2, star wars kotor, star wars kotor2" />
<LINK rel="STYLESHEET" TYPE="text/css" href="../css/style.css" />
<FORM ACTION="<?php $_SERVER["PHP_SELF"]; ?>" METHOD="post">
<TABLE>
<TR><TD COLSPAN="2"><H3>Ajout d'une Fan fiction</H3></TD></TR>
<TR><TD><FONT>Type <BR>(explication des termes voir <A HREF="http://fr.wikipedia.org/wiki/Fanfiction" TARGET="_blank"> ici</A>. Merci Wiki :-))</FONT>
</TD>
<TD><SELECT name="type" size="1">
<OPTION VALUE="o" SELECTED="true" /><FONT>Choisissez le type</FONT>
<OPTION VALUE="OS"/><FONT>One Shot (O.S.)</FONT>
<OPTION VALUE="" /><FONT></FONT>
<OPTION VALUE="" /><FONT></FONT>
<OPTION VALUE="" /><FONT></FONT>
<OPTION VALUE="" /><FONT></FONT>
</SELECT>
</TD>
</TR>
<TR><TD><FONT>Titre Fan fiction : </FONT></TD><TD><INPUT TYPE="text" NAME="titre" /></TD></TR>
<TR><TD><FONT>Chapitre N° : </FONT></TD><TD><INPUT TYPE="text" NAME="NumChap" /></TD></TR>
<TR><TD><FONT>Titre Chapitre : </FONT></TD><TD><INPUT TYPE="text" NAME="chapitre" /></TD></TR>
<TR><TD COLSPAN="2">Texte : <BR><TEXTAREA NAME="texte" COLS="100" ROWS="20" WRAP="soft"></TEXTAREA></TD></TR>
<TR><TD COLSPAN="2" ALIGN="right"><INPUT TYPE="submit" value="Annuler" /> <INPUT TYPE="submit" value="Ajouter" /></TD></TR>
</TABLE>
</FORM>
</HTML>
<?php
$type = $_POST['type'];
$titre = $_POST['titre'];
$Numchap = $_POST['NumChap'];
$chapitre = $_POST['chapitre'];
$texte = $_POST['texte'];
$auteur = $id_membre;
echo "type: $type, titre: $titre, N° chapitre: $Numchap, Titre chapitre: $chapitre, Texte: $texte";
if(empty($type) || empty($titre) || empty($Numchap) || empty($chapitre) || empty($texte))
{echo "les champs doivent être rempli";}
else
{
$db = mysql_connect($sql_server,$sql_user,$sql_pswd);
mysql_select_db($sql_bdd, $db);
$sql = "INSERT INTO tbl_chapitres(id_chapitre, num_chap, titre_chap)
VALUE('','$Numchap','$chapitre')";
mysql_query($sql)or die('Erreur SQL'.$sql.'<br>'.mysql_error());
$id_chap = mysql_insert_id();
$sql = "INSERT INTO tbl_chapitres(id_chapitre, num_chap, titre_chap)
VALUES('','$Numchap','$chapitre')";
mysql_query($sql)or die('Erreur SQL'.$sql.'<br>'.mysql_error());
echo "<BR>La modification a bien été enregistrée.";
mysql_close();
}
?> |
Partager