[php] error unexpected T_ELSE
Résolu
n0wak
Messages postés
192
Date d'inscription
Statut
Membre
Dernière intervention
-
Arsenic33 Messages postés 46 Date d'inscription Statut Membre Dernière intervention -
Arsenic33 Messages postés 46 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Voila, je reprends un site commencé (par moi-meme donc je connais le code) et bien qu'avant ça marché, la je viens d'intaller WAMPSERVER sous vista et impossible d'afficher la page voulu !
le code :
J'ai mis le else qui pose problème. j'ai vérifié mes accolades, tout à l'air normal ... suis-je aveugle :D ?
Merci ;-)
Voila, je reprends un site commencé (par moi-meme donc je connais le code) et bien qu'avant ça marché, la je viens d'intaller WAMPSERVER sous vista et impossible d'afficher la page voulu !
le code :
function ecrire_mp(){ if(isset($_POST['destinataire'])) { if(empty($_POST['sujet']) || empty($_POST['message'])) { if(empty($_POST['sujet'])) $erreur="Veuillez entrer un sujet"; if(empty($_POST['message'])) $erreur="Veuillez mettre un message"; $r=mysql_query("SELECT pseudo FROM membres ORDER BY pseudo"); ?> <form method="post"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="4%"> </td> <td width="58%"> <table width="574" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="236" rowspan="2" valign="top" background="images/msg_05.jpg"><img src="images/msg_EM.jpg" alt="" width="236" height="210" border="0" usemap="#Map2Map" /></td> <td width="295" height="71" align="center" valign="middle" background="images/msg_02.jpg" bgcolor="#ECECEC"><font color="#FF0000"><?php echo $erreur; ?></font></td> <td width="43" rowspan="2" valign="top" background="images/msg_06.jpg"><img src="images/msg_03.jpg" width="43" height="210" /></td> </tr> <tr> <td valign="top" bgcolor="#ECECEC"><table width="100%" height="102" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="78" height="22" align="center" valign="middle" class="Black">À :</td> <td width="217" height="22"><select name="destinataire" class="input_log" > <?php while($d=mysql_fetch_assoc($r)) { ?> <option value="<?php echo $d['pseudo']; ?>"><?php echo $d['pseudo']; ?></option> <? } ?> </select></td> </tr> <tr> <td width="78" height="18" align="center" valign="middle" class="Black">Sujet :</td> <td height="18" align="left"><input name="sujet" type="text" class="input_log" size="40" maxlength="255" value="<?php if(isset($_POST['sujet'])) echo $_POST['sujet']; ?>" /></td> </tr> <tr> <td width="78" height="16" align="center" valign="middle" class="Black"> </td> <td height="16" align="center"> </td> </tr> <tr> <td align="center" valign="top" class="Black">Message :</td> <td align="left" valign="top"><textarea name="message" cols="40" rows="10" wrap="physical" class="input_log" ><?php if(isset($_POST['message'])) echo $_POST['message']; ?></textarea></td> </tr> </table> <div align="right"> <input type="submit" value="Envoyer" /> </div></td> </tr> <tr> <td colspan="2"><img src="images/msg_07.jpg" width="531" height="57" /></td> <td><img src="images/msg_08.jpg" width="43" height="57" /></td> </tr> </table> <map name="Map2Map" id="Map2Map"> <area shape="rect" coords="98,21,191,69" href="mp.php?action=new_mp" /> <area shape="rect" coords="100,81,190,132" href="mp.php?action=br" /> <area shape="rect" coords="94,148,202,197" href="mp.php?action=mp_sent" /> </map></td> <td width="2%"> </td> <td width="33%"> </td> <td width="3%"> </td> </tr> </table></form> <?php } else { $exp=$_SESSION['pseudo']; $dest=$_POST['destinataire']; $suj=$_POST['sujet']; $mess=$_POST['message']; $dat=date("d.m"); $h=date("H:i"); $r=mysql_query("INSERT INTO message_prive VALUES ('','$exp','$dest','$suj','$mess','$dat','$h','')"); if($r) { $envoi_statu="Votre message à bien été envoyé à $dest."; mysql_query("INSERT INTO mess_prive_sent VALUES ('','$exp','$dest','$suj','$mess','$dat','$h','')"); } else $envoi_statu="Une erreur est survenue lors de l'envoi.<br>Veuillez signaler cette erreur au Webmaster en cliquant ici.<br>Merci de votre soutient."; ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="4%"> </td> <td width="58%"> <table width="574" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="236" rowspan="2" valign="top" background="images/msg_05.jpg"><img src="images/msg_EM.jpg" alt="" width="236" height="210" border="0" usemap="#Map2Map" /></td> <td width="295" height="71" background="images/msg_02.jpg" bgcolor="#ECECEC"> </td> <td width="43" rowspan="2" valign="top" background="images/msg_06.jpg"><img src="images/msg_03.jpg" width="43" height="210" /></td> </tr> <tr> <td valign="top" bgcolor="#ECECEC"><table width="100%" height="102" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="22" colspan="2" align="center" valign="middle" class="Black"><?php echo $envoi_statu; ?></td> </tr> <tr> <td width="78" height="16" align="center" valign="middle" class="Black"> </td> <td width="217" height="16" align="center"> </td> </tr> <tr> <td align="center" valign="top" class="Black"> </td> <td align="left" valign="top"> </td> </tr> </table> <div align="right"></div></td> </tr> <tr> <td colspan="2"><img src="images/msg_07.jpg" width="531" height="57" /></td> <td><img src="images/msg_08.jpg" width="43" height="57" /></td> </tr> </table> <map name="Map2Map" id="Map2Map"> <area shape="rect" coords="98,21,191,69" href="mp.php?action=new_mp" /> <area shape="rect" coords="100,81,190,132" href="mp.php?action=br" /> <area shape="rect" coords="94,148,202,197" href="mp.php?action=mp_sent" /> </map></td> <td width="2%"> </td> <td width="33%"> </td> <td width="3%"> </td> </tr> </table><?php } } // envoi ok else { $r=mysql_query("SELECT pseudo FROM membres ORDER BY pseudo"); ?> <form method="post"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="4%"> </td> <td width="58%"> <table width="574" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="236" rowspan="2" valign="top" background="images/msg_05.jpg"><img src="images/msg_EM.jpg" alt="" width="236" height="210" border="0" usemap="#Map2Map" /></td> <td width="295" height="71" valign="top" background="images/msg_02.jpg" bgcolor="#ECECEC"> </td> <td width="43" rowspan="2" valign="top" background="images/msg_06.jpg"><img src="images/msg_03.jpg" width="43" height="210" /></td> </tr> <tr> <td valign="top" bgcolor="#ECECEC"><table width="100%" height="102" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="78" height="22" align="center" valign="middle" class="Black">À :</td> <td width="217" height="22"><select name="destinataire" class="input_log" > <?php while($d=mysql_fetch_assoc($r)) { ?> <option value="<?php echo $d['pseudo']; ?>"><?php echo $d['pseudo']; ?></option> <? } ?> </select></td> </tr> <tr> <td width="78" height="18" align="center" valign="middle" class="Black">Sujet :</td> <td height="18" align="left"><input name="sujet" type="text" class="input_log" size="40" maxlength="255" /></td> </tr> <tr> <td width="78" height="16" align="center" valign="middle" class="Black"> </td> <td height="16" align="center"> </td> </tr> <tr> <td align="center" valign="top" class="Black">Message :</td> <td align="left" valign="top"><textarea name="message" cols="40" rows="10" wrap="physical" class="input_log" ></textarea></td> </tr> </table> <div align="right"> <input type="submit" value="Envoyer" /> </div></td> </tr> <tr> <td colspan="2"><img src="images/msg_07.jpg" width="531" height="57" /></td> <td><img src="images/msg_08.jpg" width="43" height="57" /></td> </tr> </table> <map name="Map2Map" id="Map2Map"> <area shape="rect" coords="98,21,191,69" href="mp.php?action=new_mp" /> <area shape="rect" coords="100,81,190,132" href="mp.php?action=br" /> <area shape="rect" coords="94,148,202,197" href="mp.php?action=mp_sent" /> </map></td> <td width="2%"> </td> <td width="33%"> </td> <td width="3%"> </td> </tr> </table></form> <?php } }//fin fonction ecrire un message
J'ai mis le else qui pose problème. j'ai vérifié mes accolades, tout à l'air normal ... suis-je aveugle :D ?
Merci ;-)
A voir également:
- [php] error unexpected T_ELSE
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Cmos checksum error ✓ - Forum Carte-mère/mémoire
- Playback error reconnect in 3s (1/5) francais - Forum Box et Streaming vidéo
- Whea error occt - Forum Processeur
8 réponses
En gros tu veux qu'on trouve nous même où tu loupé ta propre accolade ?
Tu connais la solution, cherche par toi même au lieu de demander aux autres de faire un travail ( c'est le terme ) chiant et pompeux
Désolé mais ce code est très agaçant à lire
tantôt tu utilise des <? } ?>
tantôt des <?php ( ce qu'il faut ) etc.
Pour situer le else supprime petit à petit ton code ( ctrl +x )
Tu connais la solution, cherche par toi même au lieu de demander aux autres de faire un travail ( c'est le terme ) chiant et pompeux
Désolé mais ce code est très agaçant à lire
tantôt tu utilise des <? } ?>
tantôt des <?php ( ce qu'il faut ) etc.
Pour situer le else supprime petit à petit ton code ( ctrl +x )
l'erreur : Parse error: syntax error, unexpected T_ELSE in C:\wamp\www\datexcam\mp.php on line 319
et sinon, non je veux pas du travail maché, juste que ca fait bientot 1h30 que je cherche d'où ça vient et je vois pas, donc je demande un pti coup de main, mais si ca te dérange d'aider, ne te force pas, jai effectivement, non pas suprimer petit a petit mais réduit avec dreamweaver mon code et pour moi, toute les accolades sont présentes et à leur bonne place, pour le <? } ?> je n'ai pas fait attention, je vais voir ça.
merci
et sinon, non je veux pas du travail maché, juste que ca fait bientot 1h30 que je cherche d'où ça vient et je vois pas, donc je demande un pti coup de main, mais si ca te dérange d'aider, ne te force pas, jai effectivement, non pas suprimer petit a petit mais réduit avec dreamweaver mon code et pour moi, toute les accolades sont présentes et à leur bonne place, pour le <? } ?> je n'ai pas fait attention, je vais voir ça.
merci
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question