Page 1 of 1

Problem with submit

Posted: Mon Aug 01, 2005 12:25 pm
by pppswing
Hello,
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");

}
	
?>

Posted: Mon Aug 01, 2005 12:46 pm
by feyd
register globals has been off for a very very long time now... :?

Posted: Mon Aug 01, 2005 12:54 pm
by pppswing
Ah, I'm really sorry, I was reading an e-book of 2001.

Posted: Mon Aug 01, 2005 9:39 pm
by Ambush Commander
I'd suggest you get some more recent literature on PHP. There's loads of free electronic stuff out there and there are some very good paperback ones too.

Posted: Mon Aug 01, 2005 10:18 pm
by timvw
here is one for free..