Problem with submit

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pppswing
Forum Commoner
Posts: 33
Joined: Thu Jun 10, 2004 2:04 am
Location: Tallinn, Estonia

Problem with submit

Post 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");

}
	
?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

register globals has been off for a very very long time now... :?
pppswing
Forum Commoner
Posts: 33
Joined: Thu Jun 10, 2004 2:04 am
Location: Tallinn, Estonia

Post by pppswing »

Ah, I'm really sorry, I was reading an e-book of 2001.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

here is one for free..
Post Reply