[PHP] Problème Connection Livre d'or

Fermé
jamis - 12 juil. 2005 à 13:11
reinearthur Messages postés 58 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 3 octobre 2007 - 12 juil. 2005 à 14:46
Bonjour,

Voila mon index.php de mon livre d'or :
<html>
<head><title>Livre d'or</title>
<link rel="stylesheet" href="Css/style.css" type="text/css" title="style1">
<script>
function add_smile(smile) {
var smtexte = form_mess.msg.value + "";
form_mess.msg.value = form_mess.msg.value + smile
} 
</script>


</head>
<body>


<form method="get" action="form.php" name="form_mess">  
<input type="hidden" name="ajout" value="true">  

<center><br>
<table cellspacing=0 cellpadding=0  width=45%>
<tr><td width"30%"><center>Votre pseudo (*) : </td><td width="70%"><br>
<center><input type=text name=nom size=40><br><br>
</td></tr>
<tr><td width"30%"><center>Votre e-mail : </td><td width="70%"><br>
<center><input type=text name=mail size=40><br><br>
</td></tr>
<tr><td width"30%"><center>Votre note : </td><td width="70%"><br>
<center>
<select name=note size=1>
<option value=0>--
<option value=10>10 : Génial    
<option value=9>9
<option value=8>8
<option value=8>7
<option value=6>6
<option value=5>5 : Moyen   
<option value=4>4
<option value=3>3
<option value=2>2
<option value=1>1
<option value=0>0 : Complètement nul  
</select>              
<br><br>
</td></tr>
<tr><td>
<p align=right>
<table cellspacing=0 cellpadding=0  width=90%>
<tr><td>

<center>
<table cellspacing=0 cellpadding=0  width=80% class=vide>
<tr><td>
<IMG alt="" src="images/sourire.gif" onclick="javascript:add_smile('[sourire]');"> 
<IMG alt="" src="images/clindoeil.gif" onclick="javascript:add_smile('[clin]');"> 
<IMG alt="" src="images/siffle.gif" onclick="javascript:add_smile('[siffle]');"> 
<IMG alt="" src="images/heureux.gif" onclick="javascript:add_smile('[heureux]');"> 
<IMG alt="" src="images/magicien.gif" onclick="javascript:add_smile('[magicien]');"> 
<IMG alt="" src="images/content.gif" onclick="javascript:add_smile('[content]');"> 
<IMG alt="" src="images/pinch.gif" onclick="javascript:add_smile('[pinch]');"> 
<IMG alt="" src="images/rire.gif" onclick="javascript:add_smile('[rire]');"> 
<IMG alt="" src="images/pirate.gif" onclick="javascript:add_smile('[pirate]');"> 
<IMG alt="" src="images/incertain.gif" onclick="javascript:add_smile('[incertain]');"> 
<IMG alt="" src="images/incroyable.gif" onclick="javascript:add_smile('[incroyable]');"> 
<IMG alt="" src="images/waw.gif" onclick="javascript:add_smile('[waw]');"> 
<IMG alt="" src="images/demon.gif" onclick="javascript:add_smile('[demon]');"> 
<IMG alt="" src="images/tirelangue.gif" onclick="javascript:add_smile('[langue]');"> 
<IMG alt="" src="images/malheureux.gif" onclick="javascript:add_smile('[bad]');"> 
</td></tr></table>


</td></tr></table>
</td><td>
<center>
<br>
Votre message (*) :<br>
<textarea  name="msg"></textarea>
<br><br>
</td></tr></table>

<br>




<br>
<input type=submit value="Ajouter le message" ><br><br><br>




 <?include('affiche.php');?>


Voila mon connexion.php :
<?
$link = mysql_connect ('localhost', 'root', '') or die ("Impossible de se connecter");
mysql_select_db ("commentaire") or die ("Impossible d'accéder à la base de données");
?>


Le form.php :
<?

include('connexion.php');


$nom=$HTTP_GET_VARS["nom"];
$msg=$HTTP_GET_VARS["msg"];
$mail=$HTTP_GET_VARS["mail"];
$note=$HTTP_GET_VARS["note"];

$message = htmlentities($msg ,ENT_QUOTES );


$date=date('Y/m/d');


$query="INSERT INTO `guestbook` ( `id` , `date` , `name` , `email` , `COMMENT` ,  `note`  ) VALUES ('', '$date', '$nom', '$mail', '$message' , '$note')";


$result=mysql_query($query) or die("Query1 failed");

echo"<script>location.replace(\"index.php\")</script>"; 

mysql_close($link);

?>


Et sur index.php, quand j'écris un message et que je l'envoie il me dit impossible de se connecter.
Quel est le probleme ?
Si vous avez besoin des autre de mes fichers demandez moi !
A voir également:

1 réponse

reinearthur Messages postés 58 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 3 octobre 2007 8
12 juil. 2005 à 14:46
Bonjour,
tu as bien une base de données mysql installée?
0