PHP and accessibility

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

horsleyaa
Forum Newbie
Posts: 20
Joined: Tue Mar 01, 2005 8:52 am
Location: Aylesbury, UK

PHP and accessibility

Post by horsleyaa »

Hi,

I am after creating a website using PHP. I currently have a site that uses style sheets to address the accessibility issues. I have made it so that users can choose their style sheet and this choice would be recorded in a cookie. When they move around the sight the cookie is read and the pages come up using the style sheet of their choice. This causes problems for the browsers that can’t use style sheets, so can you tell me how I can create a site using PHP that allows the user to select a style and the pages are generated using that style. The choice could be recorded by putting the format after the file name using a ?. So the links would have to add on a ? and the format automatically.

Can you help?

Just to note I do not have access to mySQL, also I don't think I can have script generating and saving stuff, if I can't do it any other way I will have to contact the host to get the writing enabled.

Ashley Horsley
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

template engine.. we've talked about them quite a bit.
horsleyaa
Forum Newbie
Posts: 20
Joined: Tue Mar 01, 2005 8:52 am
Location: Aylesbury, UK

Post by horsleyaa »

can you suggest any links?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

this is the larger more theory one: viewtopic.php?t=21887
viewtopic.php?t=29176


searching for "templat* engine" shouldn't be all that hard..
horsleyaa
Forum Newbie
Posts: 20
Joined: Tue Mar 01, 2005 8:52 am
Location: Aylesbury, UK

Post by horsleyaa »

Thanks for this.
I am completely new to PHP coding so I don't particuarly understand. Could you give me a checklist that I can use?
Also How would I be able to make it so the user could change their stylesheet and this stylesheet would be used on the other pages?
Many thanks
Ashley
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

there's no simple checklist.. I'd suggest using Smarty maybe: http://smarty.php.net

as for changing it for all pages, pass the information via cookies, url, user settings, sessions.. there are many ways..
horsleyaa
Forum Newbie
Posts: 20
Joined: Tue Mar 01, 2005 8:52 am
Location: Aylesbury, UK

Post by horsleyaa »

how would I be able to use several styles?
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

What browser doesn't use the stylesheet?
horsleyaa
Forum Newbie
Posts: 20
Joined: Tue Mar 01, 2005 8:52 am
Location: Aylesbury, UK

Post by horsleyaa »

In terms of accessibility not all browsers can support stylesheets
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

I know that. I am trying to find out when this will be a problem for you.

There are some browsers that you will never be able to do anything for - stylesheet or not. So accepting that, how many people will be impacted if browserX is not supported? When do you decide that you cannot do anything for that browser because of fundamental limitations in the browser itself?

So the question remains. What browser are you aware of that doesn't support stylesheets for the purpose of enhancing accessibility? How many people do you feel would be affected?

Given the following browser stats, who do do you feel is affected and to what level?
IE - 89.9%
FireFox - 5.7%
Non-FireFox Mozilla - 2.8%
Safaria 1.2%

Part of finding a solution is knowing the extent of the problem.
horsleyaa
Forum Newbie
Posts: 20
Joined: Tue Mar 01, 2005 8:52 am
Location: Aylesbury, UK

Post by horsleyaa »

I don't personally know of any browsers that don't support stylesheets but it would be a lot easier if I could serve pages with the acontent in the correct form.
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

I agree and it is a good thing to do but in terms of the real world relatively few people would use a browser that would present that particular problem. In all likelihood the people that need accessibility support would have a browser that handles stylesheets properly because they can dramatically improve readability, etc.

The ackward part for you as a web developer is trying to emulate stylesheet behavior in browsers that don't support stylesheets properly. You would have to generate pure HTML for those cases. But then strip the formatting from the HTML and send cleaner pages and CSS to the browsers that support it because there is no point is sending bloated pages to browsers that are actually better equipped to display pages than non-CSS browsers.

And then you have the issue that you can do some things with stylesheets that you cannot do without them. How do you address that?

I am trying to find out if the hassles of supporting an old or severely limited browser is worth the extended amount of time that you would spend attempting to add accessibility features to it.
horsleyaa
Forum Newbie
Posts: 20
Joined: Tue Mar 01, 2005 8:52 am
Location: Aylesbury, UK

Post by horsleyaa »

Unfortunately I do need to have accessibility features on the pages and therefore need to serve the pages. I am thinking of using PHP to generate the pages. Yes I agree that it is quite a lot of work, but it has to be done. I will also need to produce text only versions of the pages - how would this be done is PHP
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

So tell me what you expect to do in order to make it happen? Will you be generating CSS and non-CSS pages? Or are you going to generate pages that have fully formed HTML and also CSS to enhance browsers that support it?

Are you changing an existing site? What does the site do?

I'm not trying to nitpick, this all can make a difference in the implementation.
horsleyaa
Forum Newbie
Posts: 20
Joined: Tue Mar 01, 2005 8:52 am
Location: Aylesbury, UK

Post by horsleyaa »

fully formed HTML pages will be generated
Post Reply