how can we use php coding with CSS to set a theme in webpage. for example phpnuke
thanks
Oh No!:themes in php?>
Moderators: egami, macek, gesf
- sarjanajava
- New php-forum User
- Posts: 39
- Joined: Wed Nov 27, 2002 10:59 pm
- Contact:
- Joan Garnet
- Moderator
- Posts: 387
- Joined: Sat Aug 03, 2002 2:56 am
- Location: Mars
- Contact:
Maybe you mean to dinamically select a style from a form or from a value kept in a database ?
:
Code: Select all
<link href="<?php echo $my_css; ?>" rel="stylesheet" rev="stylesheet" type="text/css">

- sarjanajava
- New php-forum User
- Posts: 39
- Joined: Wed Nov 27, 2002 10:59 pm
- Contact:
i mean that how can i set up themes in my site , for example like phpnuke
what coding ?
what coding ?
- Joan Garnet
- Moderator
- Posts: 387
- Joined: Sat Aug 03, 2002 2:56 am
- Location: Mars
- Contact:
That's it.
You need different .css files with different styles and then link them as you want.
When a user registers to your site, he can choose the login, password and style.
It can be saved in a txt file or if you have Mysql access, in a table.
You need different .css files with different styles and then link them as you want.
When a user registers to your site, he can choose the login, password and style.
It can be saved in a txt file or if you have Mysql access, in a table.
- WiZARD
- Moderator
- Posts: 1240
- Joined: Thu Jun 20, 2002 10:14 pm
- Location: Ukraine, Crimea, Simferopol
- Contact:
Principle as same in all programm:
common.php
index.php
common.php
Code: Select all
<?PHP
$theme="silver"
.......
?>
index.php
Code: Select all
<link href="<?=$theme; ?>.css" rel="stylesheet" rev="stylesheet" type="text/css">
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";


- sarjanajava
- New php-forum User
- Posts: 39
- Joined: Wed Nov 27, 2002 10:59 pm
- Contact:
can u give me full coding? thanks
sarjanajava wrote:can u give me full coding? thanks
he just did give you the full code.. all you have to do is edit common.php where is says
$theme ="silver";
or what ever theme that you like to add then.. in the index page of your site.. you will add...
<link href="<?=$theme; ?>.css" rel="stylesheet" rev="stylesheet" type="text/css">
this is pointing at your theme dir where your subdir is (silver) and it uses the style.css file for its colors.. for example if you wanted to just add it on one page then just do ..
Code: Select all
$theme ="silver";
<link href="<?=$theme; ?>.css" rel="stylesheet" rev="stylesheet" type="text/css">
you can add that to your index page as well
i dont know to mutch about themes but i do know that is how
you do it (im still a newbie at php)
Computer/Programm rox.. (php, c/c++ will take over soon muhahah