Changing CSS with Radio buttons

Questions and tutorials related to Cascading Style Sheets *all versions*

Moderators: egami, macek, gesf

Post Reply
Suhoij
New php-forum User
New php-forum User
Posts: 92
Joined: Tue Aug 17, 2010 2:00 am
Location: Ukraine Kharkov
Contact:

Sun Aug 22, 2010 2:58 am

Do you use any template engine? In your code you need only echo the css:

Code: Select all

<?

  $stl = $_REQUEST['style'];

switch($stl)
{
case 1: echo  "css/style1.css";
break;
case 2: echo  "css/style2.css";
break;
case 3: echo  "css/style3.css";
break;
case 4: echo "css/style4.css";
break;
}
?>

Suhoij
New php-forum User
New php-forum User
Posts: 92
Joined: Tue Aug 17, 2010 2:00 am
Location: Ukraine Kharkov
Contact:

Sun Aug 22, 2010 12:44 pm

Ok I see another thing - you must include the file here:

Code: Select all

<link rel="stylesheet" type="text/css" href="<?php include 'stl.php'; ?>" />


User avatar
WebOutGateway
New php-forum User
New php-forum User
Posts: 65
Joined: Mon Jun 13, 2011 9:25 pm
Location: Pasig City, Philippines
Contact:

Tue Aug 05, 2014 6:42 pm

Hi!

Try moving your downloaded folder in your project's folder. Find the .css file and link it to your web page/s by adding this inside your <head> section.

Code: Select all

<link rel="stylesheet" type="text/css" href="yourStyle.css">
The href will define your .css file.

I hope this helps. Thank you.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest