Probleme pour inserer un favicon

Petit nouveau ! | 8 Messages

28 oct. 2008, 00:22

Bonjour tout le monde

alor voila j'aimerer inserer un favicon sur mon site web en PHP puisque c'est a partir d'un theme Nuked Klan et quand j'insere les ligne

Code : Tout sélectionner

<link rel="shortcut icon" href="/images/favicon.ico" />
il me met une erreur
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/web/clients/ghost.hostarea.org/www/themes/classik_storm/theme.php on line 42
donc voila savez vous comment resoudre mon probleme

et voici dans quoi je veu l'insere
<?php
//   ---------------------------------------------------------------------------------------------------------------
//  ----------------------------------------------------------------------------------------------------------------
//
// Nuked-KlaN 1.7.x
// Nuked-Klan SP4
// Testé compatible sur Internet Explorer / Firefox / Opera
// Valid XHTML
//
//
//
//          THEME:  classik_storm
//
//
//           Auteur     :  Réalisé par www.classik-nk.com ( Création de thèmes Nuked Klan )
//           Designer   :  Huma
//           Codeur     :   ClassikD 
//   
//
// Plus de thèmes disponibles sur classik-nk.com ! 
// Pour tout renseignement, report de bug, demande de thème , reportez vous sur le Forum.
// Les Sources des thèmes sont disponibles sur le site afin de faciliter toute modification. 
// WWW.CLASSIK-NK.COM
//
//  ------------------------------------------------------------------------------------------------------------------
//  ------------------------------------------------------------------------------------------------------------------
function top() /// ouverture de la fonctions top Défini le haut et la gauche du site
{
global $nuked, $op, $file, $page;

echo" 
<!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\" />
<meta http-equiv=\"content-style-type\" content=\"text/css\" />
<meta name=\"keywords\" content=\"" . $nuked['keyword'] . "\" />
<meta name=\"Description\" content=\"" . $nuked['description'] . "\" />
<title>:: $nuked[name] :: $nuked[slogan] - </title>
<link href=\"themes/classik_storm/style.css\" rel=\"stylesheet\" type=\"text/css\" /> 
<script type=\"text/javascript\" src=\"themes/classik_storm/flash.js\"></script>
</head>
<body>
<table style=\"width:1000px;height:223px;margin:auto;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  <tr>
    <td>";?>
		  <script type="text/javascript">show_flash('1000', '223', 'themes/classik_storm/images/header_classik_storm.swf', '#FFFFFF', '<?php echo "team=" . $nuked['name']; ?>');</script>
		  <?php echo "</td>
  </tr>
</table>
<table style=\"width:1000px;height:79px;margin:auto;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"themes/classik_storm/images/blocks.jpg\">
  <tr>
    <td style=\"width:237px;\"><table style=\"width:237px;height:79px;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td style=\"width:582px;\"><table style=\"width:582px;height:79px;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
      <tr>
        <td style=\"width:300px;vertical-align:top;color:#9f9f9f;\">";include('themes/classik_storm/block_wars.php');echo"</td>
        <td style=\"width:282px;vertical-align:top;\">";include('themes/classik_storm/block_news.php');echo"</td>
      </tr>
    </table></td>
    <td style=\"width:181px;\"><table style=\"width:181px;height:79px;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
<table style=\"width:1000px;margin:auto;background-image: url('themes/classik_storm/images/background.jpg');\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  <tr>
    <td style=\"width:22px;\"><table style=\"width:22px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td style=\"width:183px;vertical-align:top;\">
	"; get_blok('gauche'); echo "
	</td>
    <td style=\"width:590px;vertical-align:top;\">
	";
if ($op == "index" && $file != "Admin" && $page != "admin") get_blok('centre');
} 

function footer() 
{
global $nuked, $op, $file, $page;
    if ($op == "index" && $file != "Admin" && $page != "admin")  get_blok('bas');
echo "
	</td>
    <td style=\"width:182px;vertical-align:top;\">
	"; get_blok('droite'); echo "
	</td>
    <td style=\"width:23px;\"><table style=\"width:23px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
<table style=\"width:1000px;height:34px;margin:auto;background-image: url('themes/classik_storm/images/footer.jpg');\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  <tr>
    <td style=\"width:22px;\"><table style=\"width:22px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td style=\"width:183px;\"><table style=\"width:183px;height:34px;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
      <tr>
        <td style=\"color: white;text-align: center;\">
		<span style=\"color: white;\"><strong><a href=\"http://www.classik-nk.com/\" title=\"Classik-NK: Création de thèmes Nuked Klan - NK\" style=\"color: white;\">Thème créé par Classik-NK </a></strong></span>
		</td>
      </tr>
    </table></td>
    <td width=\"590\" style=\"color: white;text-align: center;\"><strong>$nuked[footmessage]</strong></td>
    <td width=\"182\"><table width=\"182\" height=\"34\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
      <tr>
        <td style=\"color: white;text-align: center;\">
		<a href=\"http://www.nuked-klan.org/\" title=\"Nuked Klan\" style=\"color: white;\"> <strong>Powered By Nuked Klan</strong></a>
		</td>
      </tr>
    </table></td>
    <td style=\"width:23px;\"><table style=\"width:23px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>";
exit;
} 

function news($data)
{
echo "
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
        <tr>
          <td style=\"background-image: url('themes/classik_storm/images/titre_news.jpg');width: 590px;height: 26px;text-align: center;color:white;\"><strong>$data[titre]</strong></td>
        </tr>
      </table>
      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
        <tr>
          <td style=\"background-image: url('themes/classik_storm/images/comm_news.jpg');width: 590px;height: 19px;text-align:center;color:#9f9f9f;\">Par $data[auteur]
le $data[date]
  <a href=\"index.php?file=News&op=index_comment&news_id=$data[id]\" style=\"color: #9f9f9f;\">
Commentaires ($data[nb_comment])</a></td>
        </tr>
      </table>
      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
        <tr>
          <td style=\"background-image: url('themes/classik_storm/images/corps_news.jpg');width: 590px;text-align:left;\" class=\"contenu_news\">$data[image] $data[texte]</td>
        </tr>
      </table>
      <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
        <tr>
          <td style=\"background-image: url('themes/classik_storm/images/bas_news.jpg');width: 590px;height: 22px;\">&nbsp;</td>
        </tr>
      </table>
";
} 

function block_gauche($block) 
{
echo"
<table style=\"width: 183px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td style=\"background-image: url('themes/classik_storm/images/haut_blockg.jpg');width: 183px;text-align: center;height: 45px;vertical-align:top;\">
   <table style=\"width: 183px;\">
   <tr><td></td></tr>
   <tr><td style=\"text-align: left;padding-left:50px;color:white;\"><strong>$block[titre]</strong></td></tr>
   <tr><td></td></tr>
   </table>
</td>
</tr>
<tr>
<td class=\"contenu_colonnes\" style=\"background-image: url('themes/classik_storm/images/corps_blockg.jpg');text-align: left;width: 183px;\">
$block[content]
</td>
</tr>
<tr>
<td style=\"background-image: url('themes/classik_storm/images/bas_blockg.jpg');height:22px;width: 183px;\">
</td>
</tr>
</table>";
} 

function block_droite($block) 
{
echo"
<table style=\"width: 182px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td style=\"background-image: url('themes/classik_storm/images/haut_blockd.jpg');width: 182px;text-align: center;height: 45px;vertical-align:top;\">
   <table style=\"width: 182px;\">
   <tr><td></td></tr>
   <tr><td style=\"text-align: right;padding-right:50px;color:white;\"><strong>$block[titre]</strong></td></tr>
   <tr><td></td></tr>
   </table>
</td>
</tr>
<tr>
<td class=\"contenu_colonnes\" style=\"background-image: url('themes/classik_storm/images/corps_blockd.jpg');text-align: left;width: 182px;\">
$block[content]
</td>
</tr>
<tr>
<td style=\"background-image: url('themes/classik_storm/images/bas_blockd.jpg');height:22px;width: 182px;\">
</td>
</tr>
</table>";
} 

function block_centre($block) 
{
echo"
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"text-align: center;\">
<tr>
<td style=\"font-size: 10px; color: white;background-image: url('themes/classik_storm/images/haut_blocks_centre.jpg');text-align: center; height: 29px;width: 590px;\">
<strong>$block[titre]</strong>
</td>
</tr>
<tr>
<td class=\"contenu_news\" style=\"background-image: url('themes/classik_storm/images/corps_news.jpg');width: 590px;\">
$block[content]
</td>
</tr>
<tr>
<td style=\"background-image: url('themes/classik_storm/images/bas_news.jpg');width: 590px;height: 22px;\">
</td>
</tr>
</table>";
}

function block_bas($block)
{
echo"
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"text-align: center;\">
<tr>
<td style=\"font-size: 10px; color: white;background-image: url('themes/classik_storm/images/haut_blocks_centre.jpg');text-align: center; height: 29px;width: 590px;\">
<strong>$block[titre]</strong>
</td>
</tr>
<tr>
<td class=\"contenu_news\" style=\"background-image: url('themes/classik_storm/images/corps_news.jpg');width: 590px;\">
$block[content]
</td>
</tr>
<tr>
<td style=\"background-image: url('themes/classik_storm/images/bas_news.jpg');width: 590px;height: 22px;\">
</td>
</tr>
</table>";
}

function opentable() 
{
echo"
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"text-align: left;\">
<tr>
<td style=\"width: 590px;\">
</td>
</tr>
<tr>
<td style=\"width: 590px;\">
";
}

function closetable() 
{
echo"
</td>
</tr>
<tr>
<td style=\"width: 590px;\">
</td>
</tr>
</table>";
} 
?>
merci d'avance

ps:je ne ces pas si ces la bonne section desole je suis debutant

Avatar du membre
ViPHP
ViPHP | 3008 Messages

28 oct. 2008, 00:35

Code : Tout sélectionner

<link href=\"themes/classik_storm/style.css\" rel=\"stylesheet\" type=\"text/css\" />
Regarde bien cette ligne, il n'y a rien qui se trouve là et pas sur ta ligne de code ?

Code : Tout sélectionner

<link rel="shortcut icon" href="/images/favicon.ico" />
:idea: au niveau des guillemets

Petit nouveau ! | 8 Messages

28 oct. 2008, 00:39

desole mais je ne comprend pas tres bien en faite il y a un probleme au niveau des guillemet

Avatar du membre
ViPHP
ViPHP | 3008 Messages

28 oct. 2008, 00:43

Tu ne vois pas de différence entre les deux lignes indiquées plus haut au niveau des guillemets ?

Code : Tout sélectionner

<link href=\"......
et

Code : Tout sélectionner

<link rel=".....
La première correspond au code dans la page qui est bonne.

La second c'est la ligne que tu veux ajouter.

Petit nouveau ! | 8 Messages

28 oct. 2008, 00:53

il manque \ entre le egal et lrs guillemet

Avatar du membre
ViPHP
ViPHP | 3008 Messages

28 oct. 2008, 01:00

Eh oui ! Maintenant que tu as trouvé une petit explication ;)

Le echo s'ouvre avec un guillemet comme tu peux le voir dans ta page. Si tu ajoutes la ligne telle quelle, tu auras :

Code : Tout sélectionner

echo "<link rel="shortcut icon" href="/images/favicon.ico" />"
Du coup php considère que le echo se termine après le rel=, et comme à la fin d'un echo se termine par un point virgule, tu as l'erreur indiquée.

Il te faut donc mettre un antislash d'échappement pour tous les guillemets se trouvant dans ton echo pour qu'ils soient considérés comme faisant partie de ta chaîne de caractères et non comme fin d'echo.

Petit nouveau ! | 8 Messages

28 oct. 2008, 01:10

Donc sa doit faire

Code : Tout sélectionner

<link rel=\"shortcut icon\" href=\"/images/favicon.ico\" />
et je le met comme sa

Code : Tout sélectionner

<head> <meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\" /> <meta http-equiv=\"content-style-type\" content=\"text/css\" /> <meta name=\"keywords\" content=\"" . $nuked['keyword'] . "\" /> <meta name=\"Description\" content=\"" . $nuked['description'] . "\" /> <title>:: $nuked[name] :: $nuked[slogan] - </title> <link href=\"themes/classik_storm/style.css\" rel=\"stylesheet\" type=\"text/css\" /> <script type=\"text/javascript\" src=\"themes/classik_storm/flash.js\"></script> <link rel=\"shortcut icon\" href=\"/images/favicon.ico\" /> </head>

Avatar du membre
ViPHP
ViPHP | 3008 Messages

28 oct. 2008, 01:15

ça devrait faire l'affaire. Tu n'auras plus d'erreur normalement. Si l'image ne s'affiche toujours pas, vérifie l'URL. Je ne suis pas sûr que l'absolu est nécessaire, =\"images devrait suffire.

Petit nouveau ! | 8 Messages

28 oct. 2008, 01:21

ok merci

Avatar du membre
ViPHP
ViPHP | 3008 Messages

28 oct. 2008, 10:10

N'oublie pas de marquer résolu si c'est le cas ;)

Petit nouveau ! | 8 Messages

28 oct. 2008, 13:29

j'ai fait ce que tu ma dit voila ce que j'ai mis
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\" />
<meta http-equiv=\"content-style-type\" content=\"text/css\" />
<meta name=\"keywords\" content=\"" . $nuked['keyword'] . "\" />
<meta name=\"Description\" content=\"" . $nuked['description'] . "\" />
<title>:: $nuked[name] :: $nuked[slogan] - </title>
<link href=\"themes/classik_storm/style.css\" rel=\"stylesheet\" type=\"text/css\" />
<script type=\"text/javascript\" src=\"themes/classik_storm/flash.js\"></script>
<link rel=\"shortcut icon\" href=\"http://ghost.hostarea.org/images/favicon.ico\" />
</head>
et sa me met
Warning: include(themes/classik_storm/theme.php) [function.include]: failed to open stream: No such file or directory in /home/web/clients/ghost.hostarea.org/www/index.php on line 106

Warning: include() [function.include]: Failed opening 'themes/classik_storm/theme.php' for inclusion (include_path='.:/usr/local/apache2/php5//lib/php') in /home/web/clients/ghost.hostarea.org/www/index.php on line 106

Fatal error: Call to undefined function top() in /home/web/clients/ghost.hostarea.org/www/index.php on line 119

Administrateur PHPfrance
Administrateur PHPfrance | 11457 Messages

28 oct. 2008, 13:36

Moi, je m'interroge sur ta façon de coder.
Pourquoi générer ton HTML par un echo en PHP au lieu de l'indiquer directement ? :shock:

Avatar du membre
ViPHP
ViPHP | 3008 Messages

28 oct. 2008, 14:43

Apparemment c'est une page qu'il a repris toute faite albat, qui provient d'un thème.

Sinon le code que tu as ajouté ne touche en rien l'erreur que tu as. C'est un fichier qui manque, en l'occurence la page theme.php

Avatar du membre
Administrateur PHPfrance
Administrateur PHPfrance | 13231 Messages

28 oct. 2008, 15:13

C'est la manière d'afficher les pages "made in Nuckled Klan" :?
Connaître son ignorance est la meilleure part de la connaissance
Pour un code lisible : n'hésitez pas à sauter des lignes et indenter

twitter - site perso - Github - Zend Certified Engineer

Petit nouveau ! | 8 Messages

29 oct. 2008, 01:06

en clair sa veu dire que c'est impossible et il n'y a aucun autre moyen et nuked klan n'est pas terrible