Page 1 of 1

[SOLVED] simple problem (easy fix for someone good)

Posted: Tue Dec 07, 2004 2:26 pm
by asi0917
heres the code

Code: Select all

<html>
<?php
$color = $_REQUEST['color'];
echo ("<body bgcolor=" .$color. ">");
?>
</body>
</html>
i want to have the page bg be $color

i feel stupid...
how do i make there not be a parse error?

Posted: Tue Dec 07, 2004 2:29 pm
by John Cartwright

Code: Select all

<?php
echo '<body bgcolor="' .$color. '">';
?>

Posted: Tue Dec 07, 2004 2:30 pm
by potsed

Code: Select all

<html>
<?php
$color = ($_REQUEST&#1111;'color']) ? '#'.$_REQUEST&#1111;'color'] : #FFF;
echo '<body style="background: '.$color.';">';
?>
</body>
</html>

Posted: Tue Dec 07, 2004 2:31 pm
by asi0917
stalker xD
anyway thnx