Reply to Re: How to modify CSS with PHP?

Your name:

Reply:


Posted by deko on 08/23/06 03:48

> or you can simply include a
> <style type="text/css">... </style> for the background image in the
> header of the page.

That sounds easier than maintaining multiple stylesheets.

Do this scenario sound correct:

Put HTML buttons on the page, something like this:

<form action="" method="post" name="newbackground">
<input type="submit" value="white">
<input type="submit" value="yellow">
</form>

Then, in the head section of the page, use PHP like this:

<head>
<style type="text/css">
<?php
if (!empty($newbackground = trim($_POST['white']))
{ ?>
#page {
background-image:url(/images/background-white.gif);
<?php }
elseif (!empty($newbackground = trim($_POST['yellow']))
{ ?>
#page {
background-image:url(/images/background-yellow.gif);
<?php } ?>
</style>
</head>

Is this correct? Something tells me I'm missing something on that form...

Thanks for the help!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация