Muffinresearch Labs by Stuart Colville

Prevent ampersands breaking validation | Comments (0)

Posted in Code on 1st June 2004, 10:15 pm by Stuart

When you have toiled to build a site that follows current web standards, it can be a real shame when adding a PHP script you find that validation gets broken.

One particular problem is where PHP functions create urls (addresses) that contain the “&” or ampersand.

To stop this from holding back an otherwise perfectly formed piece of XHTML you can use a little trick to make PHP use the html entity for the ampersand character.

Add the following to your script’s config file or anywhere that it will be included on everypage that creates sessions.

ini_set('arg_separator.ouput', '&');

Now the urls are created using the entity for ampersands and your script will now be compliant with XHTML 1.0.

Now that has got you started you can take into consideration other php.ini over-rides possible with the ini_set() function.

Post Tools

Comments: Add yours







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Using Loggerhead with mod_wsgi|(0)

Here’s a post I wrote over on the Project Fondue Blog about our use of Loggerhead with mod_wsgi under Apache. Loggerhead is the rather nice branch viewer for bazaar branches as used on Launchpad.net.

If you’re not already subscribed to the Project Fondue blog feed then I can recommend it, as there should be some interesting posts coming out of there in the coming months (yes I’m unashamedly biased!).

Ubuntu: Turn off changing workspace with mouse wheel|(1)

I found the changing with the workspace with the mouse wheel really annoying. To disable it go to System => Preferences => CompizConfig (available if the compizconfig-settings-manager package is installed) and uncheck “Viewport Switcher” which is under the “Desktop” heading.

Photos on Flickr

© Copyright 2004-10 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.656s.