Mark Sargent wrote:
Hi All,
I get the error for line 15 for this code,
<?php
15 echo "<font face='"$_SESSION['font']"'";
16 echo " size='"$_SESSION['size']"'";
17 echo " color='"$_SESSION['colour']"'>";
18 echo "$_SESSION['text']";
19 echo "</font>";
20 ?>
I have put ' ' quotes around the " " quotes for each font attribute so
that the parser doesn't think the echo is finished too early. Is that
wrong? I know that this code would get tedious for lots of text and
CSS would be better, but, it's just a little study project from the
book I'm following. Cheers.
Mark Sargent.
any of these will work:
echo "<font face='".$_SESSION['font']."'"; //note the . before and
after the variable.
echo "<font face='{$_SESSION['font']}'";
echo "<font face='$_SESSION[font]'";//no quotes around the index key
ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php