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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
asi0917
Forum Commoner
Posts: 41
Joined: Thu Nov 25, 2004 10:37 am
Location: Shoreline, Washington
Contact:

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

Post 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?
Last edited by asi0917 on Tue Dec 07, 2004 2:30 pm, edited 1 time in total.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

<?php
echo '<body bgcolor="' .$color. '">';
?>
User avatar
potsed
Forum Commoner
Posts: 50
Joined: Sat Oct 09, 2004 12:00 pm
Location: - South Africa

Post by potsed »

Code: Select all

<html>
<?php
$color = ($_REQUEST&#1111;'color']) ? '#'.$_REQUEST&#1111;'color'] : #FFF;
echo '<body style="background: '.$color.';">';
?>
</body>
</html>
User avatar
asi0917
Forum Commoner
Posts: 41
Joined: Thu Nov 25, 2004 10:37 am
Location: Shoreline, Washington
Contact:

Post by asi0917 »

stalker xD
anyway thnx
Post Reply