probleme erreur T_VARIABLE
Posté : 31 déc. 2018, 14:39
bonjour a tous je suis novice en matiere de codage j'apprend doucement j'essai de faire un pannel pour un jeu , je cherche a lié un formulaire à ma base de donnée mais je n'y arrive pas, j'ai besoin d'aide.
voila ce que j'ai fait, j'ai composé un fichier en html qui constitu le formulaire
je ne comprend pas l'erreur. quelqu'un peut m'aider?
voila ce que j'ai fait, j'ai composé un fichier en html qui constitu le formulaire
<!DOCTYPE html>
<html>
<head>
<title>formulaire d inscription</title>
<meta charset="utf-8"/>
</head>
<body bgcolor='#003366' style='color:#FFF'>
<form method="POST" action="inscription.php">
<!--ceci est un commentaire-->
<h1>Enregistrement des casiers</hi>
<table width="60%" border='0' cellspacing='0' cellpadding='0' style='padding-left:90px:'>
<tr>
<td align='right'>agent : </td>
<td><input type='text' name='agent' placeholder='votre identite' required="required" /></td></td>
</tr>
<tr>
<td align='right'>nom : </td>
<td><input type='text' name='nom' placeholder='nom de l auteur'required="required" /></td></td>
</tr>
<tr>
<td align='right'>prenom : </td>
<td><input type='text' name='prenom' placeholder='prenom de l auteur'required="required" /></td></td>
</tr>
<tr>
<td align='right'>infractions : </td>
<td><textarea type='text' name="infractions" placeholder='infractions commises' required="required" /></textarea></td>
<tr>
<td align='right'>prison : </td>
<td><input type='text' name='prison' placeholder='prison'></td>
</tr>
<tr>
<td align='right'>amendes : </td>
<td><input type='text' name='amendes' placeholder='amendes'></td>
</tr>
<td align='right'>infos_divers : </td>
<td><input type='text' name='infos_divers' placeholder='infos_divers'></td>
</tr>
<input type='submit' value='ok' />
</form>
</table>
</body>
</html>
et j'ai composé le fichier php pour recuperation des données a enregistré dans ma base de donné phpmyadmin
<?php
$conn=mysql_connect('localhost','root','','centrale') or die(mysqli_error());
//recuperation des information
$AGE=$_POST['agent'];
$NOM=$_POST['nom'];
$PRE=$_POST['prenom'];
$INF=$_POST['infractions'];
$PRI=$_POST['prison'];
$AME=$_POST['amendes'];
$IFO=$_POST['infos_divers'];
$req='INSERT INTO casier (agent,nom,prenom,infractions,prison,amendes,infos_divers) values ('$AGE','$NOM','$PRE','$INF','$PRI','$AME','$IFO')';
$res=mysqli_query($conn,$req);
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body bgcolor='#003366' style='color:#FFF'>
<form>
<div align='center'><h3>Le casier de </h3>
<table align='center'>
<tr>
<td align='right'>nom : </td>
<td><?php echo ($NOM)?></td>
</tr>
<tr>
<td align='right'>prenom : </td>
<td><?php echo ($PRE)?></td>
</tr>
</table>
<p>est bien enregistré </p>
<p><href='index.html'>ajouter un nouveau casier</a></p>
</div>
</form>
</body>
</html>
le formulaire s'affiche mais a la validation du formulaire cela m'affiche un message d'erreur ( ! ) Parse error: syntax error, unexpected '$AGE' (T_VARIABLE) in F:\pannel\www\test1\inscription.php on line 12je ne comprend pas l'erreur. quelqu'un peut m'aider?