Bonjour
Je suis débutant dans le domaine.
j'ai ce message d'erreur qui s'affiche lorsque j’exécute ma page pour faire un test
Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\ASSURANCE\formtest.php on line 38
Depuis hier je cherche mais je ne trouve pas la solution, j'espère pouvoir trouver de l'aide ici.
Voici mon code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans titre</title>
</head>
 
<body>
  <form method="post" action="formtest.php">
  <fieldset>
   <p>
       <label for="nom">Votre situation g&eacute;ographique</label>
       <input type="text" name="situg" id="situg" />
   </p> 
   <p> 
       Votre formule:
 
           <input type="radio" name="formule" value="eco" id="eco" /> <label for="eco">Economique</label>
           <input type="radio" name="formule" value="moyenne" id="moyenne" /> <label for="moyenne">Moyenne</label>
           <input type="radio" name="formule" value="prestige" id="prestige" /> <label for="prestige">Prestige</label>
   </p>
 
   <input type ="submit" value ="Afficher"/>
   </fieldset>
</form>
 
<?php
   if(isset($_POST["Afficher"])) // vérifie le clic sur le btn
    {
	  $option = $_POST['formule'];
      $geositu = $_POST['situg'];
	  if(isset($option) AND isset($geositu))
	  {
	    try
          {
        	$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
	        $bdd = new PDO('mysql:host=localhost;dbname=sogemad', 'root', '',$pdo_options);
	        $reponse = $bdd->query('SELECT * FROM prestataire WHERE sitegeo = '$geositu'AND optionf ='$option'');
	   ?>
	     <TABLE BORBER=1>
			 <TR>
			  <TH>PRESTATAIRE</TH><TH>LOCALISATION</TH><TH>VILLE/COMMUNE</TH><TH>TELEPHONE</TH><TH>FORMULE</TH><TH>CATEGORIE</TH>
			 </TR>
	   <?php 
 
			 while ($donnees = $reponse->fetch())
			  {  
		?>
		      <TR>
				<TD><?php echo "$donnees['nompresta']"?></TD><TD><?php echo "$donnees['situgeo']"?></TD>
				<TD><?php echo "$donnees['commune']"?></TD><TD><?php echo "$donnees['tel']"?></TD>
				<TD><?php echo "$donnees['optionf']"?></TD><TD><?php echo "$donnees['categorie']"?></TD>
			 </TR>
		      <?php 
	            }
              ?>
        </TABLE>
		<?php 
	  $reponse->closeCursor();
         }
      catch (Exception $e)
 {
	die('Erreur : ' $e->getMessage());
 }
?>
 
</body>
</html>
Merci pour votre aide