Jump to content

PHP and XHTML/CSS compliance?


woolyg

Recommended Posts

Hi all,

I thought I'd post this as a discussion/commentary rather than a help request, as I'm just getting in to learning about it.

 

I've been piecing together PHP and CSS of late, coming from a dumdum HTML background, and have had an idea for a site that I think will work pretty well, so I am working on a good, XHTML/CSS compliant PHP site that can be viewed & used without issue across all browsers & platforms.

 

Have any of you had any major headaches in successfully validating PHP-infused XHTML/CSS pages?

Is it actually possible to do? - Am I barking up the wrong tree..?

Are there any major pitfalls to look out for?

 

All discussion / comments are much appreciated.

Cheers,

Link to comment
Share on other sites

It is certainly possible. Keep in mind that by the time the validation takes place, it is only what the browser sees that is validated, so none of your PHP exists in the code any longer. You are simply validated the resulting markup. I strive for every page I write to be at the minimum XHTML compliant. You can double check my main page on a current site I'm putting together at http://pts.guahanweb.com if you'd like. Last I checked, my markup and CSS validates there.

Link to comment
Share on other sites

Obsidian,

Congratulations on your compliance :)

 

Thats a great help - I was worried that the markup output by ECHO statements and various PHP jiggerypokery might affect the compliance, but now I know that careful construction will aid validation.

 

If I use includes on my page, I need to ensure they are validated also, is that correct? I am trying to bring in modules to each page so that sections can be coded separately..

 

WoolyG

Link to comment
Share on other sites

PHP outputs (X)HTML/CSS/Javascript content when the page is requested. The overall page is what must be valid and is what is validated.

 

Individual include files are not validated, because they don't have meaning until they have been included into a page. In fact, because of the doctype/html/head/body structure of a web page, include files would not validate because each of them would not necessarily contain all the structural elements required to make a whole web page (depending on how you are using includes.)

Link to comment
Share on other sites

Ahh... ok:)

Thanks for that!

Woolyg

 

Where the problem lies is that some servers will attach your PHPSESSID to the end of a query string, and it will use the arg_separator.output definition for tacking it onto the end. So, if you don't put the & as the output, you'll may a straight &PHPSESSID=[whatever] tacked on to the end of every link that will cause your page not to validate.

Link to comment
Share on other sites

Yeah - I've seen that alright - but the server I'm using seems to only append &PHPSESSID=[whatever] to a URL if I haven't specified the exact url yet, and left it blank (eg. <a href=''>Link</a>). In formed links, it seems ok - but I'll definitely keep an eye out for it.

 

Can any of you guys think of any other problems with XHTML validation? This is all helping muchly.

 

 

 

 

Link to comment
Share on other sites

  • 3 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.