I try to begin php with mysql so I create database, then form, then script.
But each time I try this, it goes to Voila. Which means that the submit stuff is not working. I don't know why ?
Thanx
Code: Select all
<form method="post" action="docu_script.php">
<b>Titre :</b> <input type="text" size="50" name="Titre">
<br /><br />
<b>Auteur :</b> <input type="text" size="50" name="Auteur">
<br /><br />
<b>Nombre de Page :</b> <input type="text" size="4" name="Page">
<br /><br />
<b>Annee d'Edition : <input type="text" size="4"name="Edition">
<br /><br />
<b>Editeur :</b> <input type="text" size="50" name="Editeur">
<br /><br />
<b>Langue :</b> <input type="text" size="50" name="Langue">
<br /><br />
<b>Classification 1er niveau :</b>
<select name="Classification_1">
<option value="Informatique">Informatique</option>
<option value="Commerce">Commerce</option>
<option value="Divers">Divers</option>
</select>
<br /><br />
<b>Classification 2nd niveau :</b> <input type="text" size="30" name="Classification_2">
<br /><br />
<b>Description :</b><br />
<textarea rows="5" cols="50"></textarea>
<br /><br />
<input type="submit" name="Entree" value="Entree">
<br /><br />
<input type="reset" name="RAZ" value="RAZ">
<br /><br />
</form>Code: Select all
<?php
$link=mysql_connect("localhost","root") or
die("could not connect to MySQL");
mysql_select_db("Document") or
die("could not connect to Document");
if($Entree == "Entree")
{
$query = "insert into T_Document
(Titre, Auteur, Nombre_Page, Annee_Edition, Editeur,
Classification_1, Classification_2, Description) values
('$Titre', '$Auteur', '$Nombre_Page', '$Annee_Edition', '$Editeur',
'$Classification_1', '$Classification_2', '$Description')";
mysql_query($query) or die(mysql_error());
mysql_close($link);
?>
<h2>Donnees Entrees</h2>
<a href="index.php">retour</a>
<?php
} else{
die("Voila");
}
?>