4images Forum & Community

4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: Axel on March 20, 2003, 02:21:48 PM

Title: Parse error
Post by: Axel on March 20, 2003, 02:21:48 PM
Hallo,

ich include in die Temlates auch eine Navi. Da klappt auch.
Sobald ich jedoch die Zeilen inder Navi mittels

Code: [Select]

<?php
$color 
"";
if &
#40;$mark == "3"&#41;
&#123;
$color "bgcolor=\"#FF9900\"";
&
#125;
else 
&
#123;
$color "";
&
#125;
?>

  <tr>
    <td height="17" colspan="3"
    <?php 
    
echo $color 
    ?>

    >


je nach Wert farbig machen möchte, erhalte ich

Code: [Select]

Parse error: parse error in /pfad/includes/template.php(133) : eval()'d code on line 383



Auch mit der eigentlich üblichen schreibweise:

Code: [Select]

    <td height="17" colspan="3"  <?php  echo $color ?>>


erhalte ich gleiche Fehlermeldung.

Wie könnte ich das lösen?
Title: Parse error
Post by: V@no on March 20, 2003, 02:36:56 PM
sorry for english respond.
u MUST put open ( <?php ) and closing ( ?> ) php tags ALONE in the line, and without ANYTHING, not even spaces on same line.
here is how your code should looks like:
 
Code: [Select]
<?php 
$color 
""
if &
#40;$mark == "3"&#41; 
&#123; 
   
$color "bgcolor=\"#FF9900\""
&
#125; 
else 
&
#123; 
$color ""
&
#125; 
?>

  <tr>
    <td height="17" colspan="3"
<?php
    
echo $color 
?>

    >
Title: Parse error
Post by: Axel on March 20, 2003, 03:07:04 PM
Sorry, but I speak no English.¶

Where is the difference to my first variant?¶
Title: Parse error
Post by: V@no on March 20, 2003, 03:27:10 PM
wrong:(http://home.attbi.com/~vanowm/var2.gif)
correct:(http://home.attbi.com/~vanowm/var1.gif)
Title: Parse error
Post by: Axel on March 20, 2003, 03:40:35 PM
Ok.  :?

In addition, it does not function in such a way unfortunately.
The error message remains the same.  :(
Title: Parse error
Post by: V@no on March 20, 2003, 03:53:43 PM
ops...missed the mistake:
Quote
echo $color;
Title: Parse error
Post by: Axel on March 20, 2003, 05:07:35 PM
Thanks.  :D

That was the error.  :wink: