Jump to content

How to format php pages using CSS??


misheck

Recommended Posts

I am studying PHP and I have an exercise whereby I have to I have to include on a page an option for users to select the fontsize, color and font choice. So I have created a css page option value> I need to know what statement ($_SESSION)  I will have to add to my php page so that it can include the css selected value. I also need to allow users have an option to save these settings as a cookie so they can be remebered next time they login.

 

I have put an include file on a test login file (<?php include "test.css";?>)

Link to comment
https://forums.phpfreaks.com/topic/130023-how-to-format-php-pages-using-css/
Share on other sites

1. Use something like http://www.colourpicker.com/ and have the selected value posted to a PHP page where the value is saved in a session:

 

$_SESSION['anyNameYouWant']=$_POST['ValuePosted'];

 

2. When you need to display, just:

 

<span style="font-color:<?php echo $_SESSION['anyNameYouWant']; ?>">This Text Is In Your Selected Colour</span>
This Is Not In Your Colour

 

This should start you off.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.