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>



Django Admin Ominigraffle Stencil|(0)

Colleague Alex Lee has created a nice stencil for omingraffle with the Django Admin UI components, perfect for wireframing customised admin screens. For more details and to download the stencil see Alex’s Blog csensedesign.co.uk

Scrolling issue in Leopard cured with PRAM reset|(0)

Having got a shiny new MacBook Pro to work on at my new workplace I’ve had a couple of strange problems with Leopard. The main issue was that when scrolling the graphics was suffering what appeared to be a strange redraw problem when scrolling. After googling I found this post:“Distorted graphics in Leopard when scrolling”.

Fortunately for me: resetting the PRAM has worked and the flickering issue has gone for now.

Photos on Flickr

© Copyright 2004-08 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by 1&1 This page was baked in 0.704s.