ce code PHP me genère une erreur disant:
!) Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\wamp\www\tests\formulaire.php on line 21
la ligne 21 c'est:
<form name="leformulaire" action="execute.php" <?php if(isset($_GET['action']) && $_GET['action']=="modif"){ echo "?action=modif&num=$_GET['num']"; } ?> method="post">
voici le code:
<html>
<body>
<?php
$hote="localhost";
$utilisateur="root";
$modpasse="";
$connection= mysql_connect($hote, $utilisateur, $modpasse);
//echo $connection;
$nomelabase="labase";
mysql_select_db($nomelabase, $connection);
// $requete = "SELECT * FROM latable WHERE numero=$_GET['num']";
$resultat = mysql_query($requete, $connection);
$test = mysql_fetch_row($resultat);
list ($numero, $nom, $informations, $categorie) = $test;
?>
<form name="leformulaire" action="execute.php" <?php if(isset($_GET['action']) && $_GET['action']=="modif"){ echo "?action=modif&num=$_GET['num']"; } ?> method="post">
Nom :<br>
<input name="nom" type=text length=30 value=<?php if($_GET[action]=="modif"){ echo "$nom";} ?>><br>
Informations :<br>
<textarea name="informations" cols=35 rows=6><?php if($_GET[action]=="modif"){ echo $informations;} ?></textarea><br>
Catégorie :<br>
<input type=radio name="categorie" value="news" <?php if($categorie=="news") { echo "CHECKED";} ?> >
News<br>
<input type=radio name="categorie" value="infos" <?php if($categorie=="infos") { echo "CHECKED";} ?> >
Infos<br>
<input type=radio name="categorie" value="photos" <?php if($categorie=="photos") { echo "CHECKED";} ?> >
Photos<br>
<input type=submit value="Vazy Envoie !">
</form>
</body>
</html>
merci d'avance pr votre soutien...
je n'arrive pas à denicher l'erreur.
Merci pour tout votre soutien...