Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1520 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  Probléme php erreur

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Probléme php erreur

n°1303104
sylvain421
Posté le 10-02-2006 à 16:43:23  profilanswer
 

Bonjour,
 
Je crée un site en HTML, mais pour le module de news cutenews, j'ai mit une page php. Voila le manuel de cutenews :

 

Code :
  1. Insertion de news
  2. Lorsque CuteNews est installé correctement, vous pouvez commencer à poster des news. Pour les afficher, vous devez insérer le ficher show_news.php (situé dans le dossier principal de CuteNews). Pour inclure show_news.php dans votre page vous devez utiliser le code de cette façon :
  3. <?PHP
  4. include("path/to/show_news.php" );
  5. ?>
  6. Vous devez remplacer path/to/show_news.php avec le chemin réel de show_news.php, MAIS PAS son URL !!!
  7. Exemples:
  8. CORRECT : include("cutenews/show_news.php" );
  9. MAUVAIS  : include("http://site.com/cutenews/show_news.php" );
  10. N'oubliez pas, pour utiliser du code PHP, l'extension du fichier où vous faites votre "include" doit être de type .php
  11. Pour insérer le code dans une page .html, renommez l'extension .html en .php, cela fonctionnera.


 
Voici ma page (Le script que j'ai rajouter et a la ligne 118 à 120):
 

Code :
  1. <?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Taatu-France - Bienvenue</title>
  5. <meta name="title" content="News" />
  6. <meta name="author" content="Lepopo" />
  7. <meta name="description" content="" />
  8. <meta name="keywords" content="" />
  9. <meta name="Generator" content="Joomla! - Copyright (C) 2005 Open Source Matters. All rights reserved." />
  10. <meta name="robots" content="index, follow" />
  11. <link rel="shortcut icon" href="http://www.taatu.com/cms/images/favicon.ico" />
  12. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  13. <link href="http://www.taatu.com/cms/templates/taatu/template_css.css" rel="stylesheet" type="text/css"/>
  14. <style type="text/css">
  15. <!--
  16. a:link {
  17. text-decoration: none;
  18. }
  19. a:visited {
  20. text-decoration: none;
  21. }
  22. a:hover {
  23. text-decoration: underline;
  24. }
  25. a:active {
  26. text-decoration: none;
  27. }
  28. body {
  29. margin-top: 6px;
  30. }
  31. -->
  32. </style></head>
  33. <body>
  34. <div align="center">
  35.    <img src="Image/entrecopie2ub.jpg" alt="Taatu-France" width="534" height="250" align="middle" />
  36.    <table width="1058" border="0" align="center" cellpadding="0" cellspacing="10px">
  37.  <tr>
  38.    <td width="244" valign="top">
  39.       <div class="moduletable_left">
  40.   <table width="249" height="163" class="contentpaneopen">
  41. <tr class="title">
  42.  <td width="233" height="24" valign="top" class="newsTitle"><a href="News.html?option=com_content&amp;task=view&amp;id=26&amp;lang=FR" class="newsReadon">News </a></td>
  43. </tr>
  44. <tr>
  45. <td height="131" valign="top" class="newsContent"><p>Toutes les nouveaut&eacute;s de taatu, vous serez au courant de tout ce qui se passe dans taatu.<br />
  46.   Vu que le site ne vient juste d'ouvrir nous n'avons pas encore une team de journaliste, si vous souhaitez postuler allez dans la partie contact. </p>  </td>
  47. </tr>
  48. </table>
  49. <table class="contentpaneopen">
  50. <tr class="title">
  51.  <td valign="top" class="newsTitle">
  52.   <a href="Team taatu.html?option=com_content&amp;task=view&amp;id=26&amp;lang=FR" class="newsReadon">La team taatu</a>  </td>
  53. </tr>
  54. <tr>
  55. <td valign="top" class="newsContent"><strong><table width="220" cellspacing="0" cellpadding="2" border="0" align="left"><tbody><tr><td valign="top"><img width="97" height="97" border="0" alt="TAATU, le monde" />&nbsp;</td>
  56. <td width="114" valign="top">Descriptitions, informations, interviews, etc... de la Team <strong>Taatu</strong>.</td>
  57. </tr>
  58. </tbody></table></strong></td>
  59. </tr>
  60. </table>
  61. <table class="contentpaneopen">
  62. <tr class="title">
  63.  <td valign="top" class="newsTitle">
  64.   <a href="S&eacute;curit&eacute; dans Taatu.html?option=com_content&amp;task=view&amp;id=21&amp;lang=FR" class="newsReadon">S&eacute;curit&eacute; dans taatu </a>  </td>
  65. </tr>
  66. <tr>
  67. <td valign="top" class="newsContent"><table width="220" cellspacing="0" cellpadding="2" border="0"><tbody><tr><td width="98" valign="top"><strong><img width="102" height="97" border="0" src="Image/lol taatu.JPG" alt="accuiel et Taatu's" /></strong></td>
  68. <td width="114" valign="top">Les r&eacute;gles &eacute;l&eacute;mentaires pour garder son<strong> Taatu</strong>. </td>
  69. </tr>
  70. </tbody></table></td>
  71. </tr>
  72. </table>
  73. <table class="contentpaneopen">
  74. <tr class="title">
  75.  <td valign="top" class="newsTitle">
  76.   <a href="Classement.html?option=com_content&amp;task=view&amp;id=18&amp;lang=FR" class="newsReadon">Classement</a>  </td>
  77. </tr>
  78. <tr>
  79. <td valign="top" class="newsContent"><table width="220" cellspacing="0" cellpadding="2" border="0"><tbody><tr><td valign="top"><strong><img width="97" height="97" border="0" alt="TAATU mag" src="images/homeBilingual/carre_taatumag.jpg" /></strong></td>
  80. <td valign="top">Tu m&eacute;rite d'&ecirc;tre dans le top 10 des <strong>Taatus</strong>, ou, ton aparte le m&eacute;rite, regarde si tu es dans le classement<strong>. </strong></td>
  81. </tr></tbody></table></td>
  82. </tr>
  83. </table>
  84. <table class="contentpaneopen">
  85. <tr class="title">
  86.  <td valign="top" class="newsTitle">
  87.   <a href="index.php?option=com_content&amp;task=view&amp;id=12&lang=FR" class="newsReadon">
  88.    ?????????????????</a>  </td>
  89. </tr>
  90. <tr>
  91. <td valign="top" class="newsContent"><p>Quelle sera la prochaine section ?<br />
  92.   Envoyez nous vos id&eacute;es.
  93.   <br />
  94. Plus d'info bient&ocirc;t. ;) </p>  </td>
  95. </tr>
  96. </table>
  97.  </div>    </td>
  98.   <td width="530" valign="top">
  99. <table width="471" border="0" cellpadding="0" cellspacing="0">
  100.   <tr>
  101. <td width="471" class="body_outer" valign="top">
  102.       <table class="contentpaneopen">
  103.   <tr>
  104.      <td class="contentheading" width="100%">News </td>
  105.       </tr>
  106.   </table>
  107.                      <table width="780" height="780" class="contentpaneopen">
  108.                               <tr>
  109.                                 <td width="102" height="307" colspan="2" valign="top"><p>&nbsp;</p>
  110.                                   <p><?PHP
  111. include("/cutenews/cutenews/show_news.php" );
  112. ?>&nbsp;</p>
  113.                                   <p align="left">                                </p></td>
  114.                               </tr>
  115.               </table>
  116.             <span class="article_seperator">&nbsp;</span> </td>
  117.   </tr>
  118. <tr><td class="gradient"></td></tr>
  119. </table>    </td>
  120.    <td width="244" valign="top">
  121.       <div class="moduletable_right">
  122.   <table class="contentpaneopen">
  123. <tr class="title">
  124.  <td valign="top" class="newsTitle">
  125.   <a href="News de Taatu-France.html?option=com_content&amp;task=view&amp;id=20&amp;lang=FR" class="newsReadon">News de Taatu-France </a>  </td>
  126. </tr>
  127. <tr>
  128. <td valign="top" class="newsContent"><table width="220" cellspacing="0" cellpadding="2" border="0"><tbody><tr>
  129.   <td valign="top">L'actualit&eacute;, les nouveut&eacute;s, etc... se passera dans cette partie. <strong></strong></td>
  130.   <td valign="top"><img width="97" height="97" border="0" src="images/homeFR/carre_ami_fr.jpg" alt="TAATU mag" /><br /></td></tr></tbody></table></td>
  131. </tr>
  132. </table>
  133. <table class="contentpaneopen">
  134. <tr class="title">
  135.  <td valign="top" class="newsTitle">
  136.   <a href="Forum.html?option=com_content&amp;task=view&amp;id=24&amp;lang=FR" class="newsReadon">Forum</a>  </td>
  137. </tr>
  138. <tr>
  139. <td valign="top" class="newsContent"><table width="220" cellspacing="0" cellpadding="2" border="0"><tbody><tr>
  140.   <td valign="top">Pour faire des rencontres, parler de toutes choses, etc... c'est sur le forum.</td>
  141.   <td valign="top"><img width="97" height="97" border="0" alt="questions" src="images/HomeFR/carre_questions.jpg" />&nbsp;</td></tr></tbody></table></td>
  142. </tr>
  143. </table>
  144. <table class="contentpaneopen">
  145. <tr class="title">
  146.  <td valign="top" class="newsTitle">
  147.   <a href="Team Taatu-France.html?option=com_content&amp;task=view&amp;id=22&amp;lang=FR" class="newsReadon">
  148.    Team Taatu-France </a>  </td>
  149. </tr>
  150. <tr>
  151. <td valign="top" class="newsContent">Tout sur la team de Taatu-France.</td>
  152. </tr>
  153. </table>
  154. <table class="contentpaneopen">
  155. <tr class="title">
  156.  <td valign="top" class="newsTitle">
  157.   <a href="Contact.html?option=com_content&amp;task=view&amp;id=37&amp;lang=FR" class="newsReadon">
  158.    Contact</a>  </td>
  159. </tr>
  160. <tr>
  161. <td valign="top" class="newsContent"><table width="220" cellspacing="0" cellpadding="2" border="0"><tbody><tr>
  162.   <td width="114" valign="top">Vous voulez poser vos questions au staff de Taatu-France, ou les rejoindre, ou encore autre chose, c'est par ici. </td>
  163.   <td width="98" valign="top"><strong><img width="97" height="97" border="0" src="Image/carre_questions.jpg" alt="TAATU couleur du chat" /></strong></td>
  164. </tr></tbody></table></td>
  165. </tr>
  166. </table>
  167. <table class="contentpaneopen">
  168. <tr class="title">
  169.  <td valign="top" class="newsTitle">
  170.   <a href="http://d.wogame.free.fr/Version%20du%20site.html?option=com_content&amp;task=view&amp;id=23&amp;lang=FR" class="newsReadon">
  171.    Version du site </a>  </td>
  172. </tr>
  173. <tr>
  174. <td valign="top" class="newsContent">Taatu-France met souvent le site &agrave; jour, vous pourez les d&eacute;couvrir ici. </td>
  175. </tr>
  176. </table><table class="contentpaneopen">
  177. <tr class="title">
  178.  <td valign="top" class="newsTitle">
  179.   <a href="Suggestions.html?option=com_content&amp;task=view&amp;id=23&amp;lang=FR" class="newsReadon">
  180.    Suggestions</a>  </td>
  181. </tr>
  182. <tr>
  183. <td valign="top" class="newsContent">Toutes vos id&eacute;es envoyer par mail on la r&eacute;ponse ici. </td>
  184. </tr>
  185. </table>
  186.  </div>    </td>
  187.    </tr>
  188.    <tr>
  189.    <td>    </td>
  190.    <td>
  191.       <div class="moduletable_footer">
  192.   <table width="100%" border="0" cellpadding="0" cellspacing="1"><tr>
  193.     <td nowrap="nowrap">    <blockquote>
  194.       <blockquote>
  195.         <blockquote>
  196.           <p> Taatu-France est un site de fan du site www.taatu.com </p>
  197.           </blockquote>
  198.       </blockquote>
  199.     </blockquote></td>
  200.   </tr></table>  </div>    </td>
  201.    <td>    </td>
  202.    </tr>
  203.   </table>
  204. </div>
  205. </body>
  206. </html>
  207. <!-- 1135848243 -->


 
Voila le fichier show_news :
 

Code :
  1. <?PHP
  2. error_reporting (E_ALL ^ E_NOTICE);
  3. $cutepath =  __FILE__;
  4. $cutepath = preg_replace( "'\\\show_news\.php'", "", $cutepath);
  5. $cutepath = preg_replace( "'/show_news\.php'", "", $cutepath);
  6. require_once("$cutepath/inc/functions.inc.php" );
  7. require_once("$cutepath/data/config.php" );
  8. //----------------------------------
  9. // Check if we are included by PATH
  10. //----------------------------------
  11. if($HTTP_SERVER_VARS["HTTP_ACCEPT"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_CHARSET"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"] or $HTTP_SERVER_VARS["HTTP_CONNECTION"]){ /* do nothing */ }
  12. elseif(eregi("show_news.php", $PHP_SELF)){
  13. die("<h4>CuteNews has detected that you are including show_news.php using the URL to this file.<br>
  14. This is incorrect and you must include it using the PATH to show_news.php</h4><br>Example:<br>
  15. this is <font color=red>WRONG</font> :&nbsp;&nbsp; &lt;?PHP include(\"http://yoursite.com/cutenews/show_news.php\" ); ?&gt;<br>
  16. this is <font color=green>CORRECT</font>:&nbsp;&nbsp; &lt;?PHP include(\"cutenews/show_news.php\" ); ?&gt;<br>
  17. <br><BR>// <font size=2>if you think this message shouldn't be shown, open show_news.php and delete it from there</font>" );
  18. }
  19. //----------------------------------
  20. // End of the check
  21. //----------------------------------
  22. if(!isset($subaction) or $subaction == "" ){ $subaction = $POST["subaction"]; }
  23. if(!isset($template) or $template == "" or strtolower($template) == "default" ){ require_once("$cutepath/data/Default.tpl" ); }
  24. else{
  25.         if(file_exists("$cutepath/data/${template}.tpl" )){ require_once("$cutepath/data/${template}.tpl" ); }
  26.     else{ die("Error!<br>the template <b>".htmlspecialchars($template)."</b> does not exists, note that templates are case sensetive and you must write the name exactly as it is" ); }
  27. }
  28. // Prepare requested categories
  29. if(eregi("[a-z]", $category)){
  30.         die("<b>Error</b>!<br>CuteNews has detected that you use \$category = \"$category\"; but you can call the categories only with their <b>ID</b> numbers and not with names<br>
  31.     example:<br><blockquote>&lt;?PHP<br>\$category = \"1\";<br>include(\"path/to/show_news.php\" );<br>?&gt;</blockquote>" );
  32. }
  33. $category = preg_replace("/ /", "", $category);
  34. $tmp_cats_arr = explode(",", $category);
  35. foreach($tmp_cats_arr as $key=>$value){
  36.     if($value != "" ){ $requested_cats[$value] = TRUE; }
  37. }
  38. if($archive == "" ){
  39.         $news_file = "$cutepath/data/news.txt";
  40.         $comm_file = "$cutepath/data/comments.txt";
  41. }else{
  42.         $news_file = "$cutepath/data/archives/$archive.news.arch";
  43.         $comm_file = "$cutepath/data/archives/$archive.comments.arch";
  44. }
  45. $allow_add_comment                        = FALSE;
  46. $allow_full_story                        = FALSE;
  47. $allow_active_news                         = FALSE;
  48. $allow_comments                         = FALSE;
  49. //<<<------------ Detarime what user want to do
  50. if( $CN_HALT != TRUE and $static != TRUE and ($subaction == "showcomments" or $subaction == "showfull" or $subaction == "addcomment" ) and ((!isset($category) or $category == "" ) or $requested_cats[$ucat] == TRUE) ){
  51.     if($subaction == "addcomment" ){ $allow_add_comment        = TRUE; $allow_comments = TRUE; }
  52.     if($subaction == "showcomments" ) $allow_comments = TRUE;
  53.         if(($subaction == "showcomments" or $allow_comments == TRUE) and $config_show_full_with_comments == "yes" ) $allow_full_story = TRUE;
  54.         if($subaction == "showfull" ) $allow_full_story = TRUE;
  55.         if($subaction == "showfull" and $config_show_comments_with_full == "yes" ) $allow_comments = TRUE;
  56. }
  57. else{
  58.     if($config_reverse_active == "yes" ){ $reverse = TRUE; }
  59.         $allow_active_news = TRUE;
  60. }
  61. //----------->>> Detarime what user want to do
  62. require("$cutepath/inc/shows.inc.php" );
  63.     if($_GET['archive'] and $_GET['archive'] != ''){ $archive = $_GET['archive']; } // stupid fix ?
  64. unset($static, $template, $requested_cats, $category, $catid, $cat,$reverse, $in_use, $archives_arr, $number, $no_prev, $no_next, $i, $showed, $prev, $used_archives);
  65. ?>
  66. <!-- News Powered by CuteNews: http://cutephp.com/ -->


 
Et voici l'erreur sur mon site :

Code :
  1. Parse error: parse error, unexpected T_STRING in /var/www/free.fr/a/1/d.wogame/News.php on line 1


 
Voila que dois-je faire pour régler ce probléme ?
 
Merci d'avance.

mood
Publicité
Posté le 10-02-2006 à 16:43:23  profilanswer
 

n°1303116
olivthill
Posté le 10-02-2006 à 16:53:23  profilanswer
 

Citation :

include("/cutenews/cutenews/show_news.php" );


Il semble que ce soit le problème habituel du chemin qui doit être relatif à la racine du serveur, et non pas relatif au disque où se trouve le serveur.
Donc, il faut peut-être essayer avec :

include("cutenews/cutenews/show_news.php" );

Ou bien, il faut peut-être changer la racine du serveur, définie dans le fichier de configuration Appache ou IIS ou Netscape.

n°1303129
sylvain421
Posté le 10-02-2006 à 17:07:50  profilanswer
 

J'ai éssayer :
 

Code :
  1. include("cutenews/cutenews/show_news.php" );


 
Ca marche pas. Sinon je comprend pas changer la racine du serveur ( Je suis pas du tout un pro ).

n°1303134
olivthill
Posté le 10-02-2006 à 17:15:00  profilanswer
 

Ou alors essayer

include("cutenews/show_news.php" );

parce qu'il semble bizarre qu'il y ait deux dossiers/répertoires qui s'appellent cutenews. Il faudrait savoir où se touve le fichier show_news.php par rapport à la page qui contient l'include.

n°1303143
sylvain421
Posté le 10-02-2006 à 17:20:03  profilanswer
 

olivthill a écrit :

Ou alors essayer

include("cutenews/show_news.php" );

parce qu'il semble bizarre qu'il y ait deux dossiers/répertoires qui s'appellent cutenews. Il faudrait savoir où se touve le fichier show_news.php par rapport à la page qui contient l'include.


 
Deja éssayer^^, le truc c'est j'ai le repertoire principal avec mes pages, le dossier image, et le dossier cutenews, puis on ouvre le dossier cutenews, et la on tombe sur show_news.php

n°1303373
sylvain421
Posté le 11-02-2006 à 08:53:41  profilanswer
 

up :(

n°1303503
sylvain421
Posté le 11-02-2006 à 16:40:04  profilanswer
 

Uppppppppppppp

n°1303652
sylvain421
Posté le 12-02-2006 à 09:36:14  profilanswer
 

UP  :wahoo:

n°1303655
sielfried
Posté le 12-02-2006 à 10:07:27  profilanswer
 

Qu'est-ce qu'il y a à la ligne 1 de News.php ?


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  Probléme php erreur

 

Sujets relatifs
Problème d'incompatibilité de type (erreur 13)Probleme de gestion d'erreur O.O
Problème 'image contient des erreur' avec Mambo[Résolu] Problème ASP/SQL: erreur dans la requête
Problème de LoadLibrary (erreur 2)problème d'erreur de segmentation
Probleme erreur Tomcatprobleme erreur Undefined offset variables de session
[VBA] --> Problème rapide ( erreur de syntaxe )[ASP] Probleme avec les date , erreur avec le datatype de ma bd !
Plus de sujets relatifs à : Probléme php erreur


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR