I am creating a website where i need the ability to increase the size off the font at the click of a button.
My idea was to create two style sheets normal and large then on each page access, get php to display the selected style sheet.
The Normal style sheet is default unless the user clicks large text. The large text then needs to be used on every page they visit. I also thought it would be nice if when they close the website and come back they dont have to increase the font size again as the website remembers the last option they chose.
To do this i thought that i could store a cookie on the users machine if they chose large text. So when each page loads if a cookie is present it will load the large text style sheet, otherwise if no cookie is present it will use the normal default style sheet.
I have little experience with cookies, and when i tried doing this on a lot of machines i get errors, but not on all. I think its a security setting issue, but i cant have people needing to change security settings just to have large text.
Heres my cookie code.
$normaltext='style';
$largetext='bigger';
if(isset($fontsize))
{
$textsize=$fontsize;
}
else
{
setcookie ("fontsize", $normaltext, time() +90 * 86400);
header("Location: $PHP_SELF?COOKIE_SET=1");
}
Any help and suggestions would be appreciated.
thanks
Matt