Re: [WSG] CSS and PHP
I'm not clued up on php or mySQL but if you use amersands then you need to display it as such amp; otherwise it wont validate. designer wrote: H All, I've been having a little bother with validation of my PHP generated pages. I'm new to PHP/mySQL and I'm finding that some peculiar things happen, such as /body and /html appear in the middle of the code. (???) Also, I find that submitting a URL such as: $myurl="testdate.php?houseID=$housenamechangeID=$changeover"; causes problems in that the generated pages don't validate: the ampersands seem to confuse the validator. Are these problems common, and is there somewhere I can find advice on such things? Or am I overtired and making a mess of things? Any help gratefully received!
RE: [WSG] CSS and PHP
designer I'm new to PHP/mySQL and I'm finding that some peculiar things happen, such as /body and /html appear in the middle of the code. Difficult to know without seeing a URL and the associated PHP code. Sound like an error in the PHP to me, though... $myurl=testdate.php?houseID=$housenamechangeID=$changeover; causes problems in that the generated pages don't validate: the ampersands seem to confuse the validator. As with any other XHTML, needs to be encoded as amp; $myurl=testdate.php?houseID=$housenameamp;changeID=$changeover; Or am I overtired and making a mess of things? Possibly :) P Patrick H. Lauke Web Editor / University of Salford http://www.salford.ac.uk Web Standards Project (WaSP) Accessibility Task Force http://webstandards.org/ ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] CSS and PHP
Just a quick note that'll help: In the URL, the special characters (such as ampersands, question marks, etc) need to be converted to html character entities. You can find entity codes from: http://www.ascii.cl/htmlcodes.htm For example: ampersand can be #38; or amp; question mark is #63; Therefore your code is: $myurl = 'testdate.php#63;houseID={$housename}#38;changeID={$changeover}'; You can also do this automatically by using the PHP function htmlspecialchars() [1] [1] http://php.net/manual/en/function.htmlspecialchars.php Tim designer wrote: $myurl=testdate.php#63;houseID=$housename#38;changeID=$changeover; ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] CSS and PHP
On Mon, 14 Nov 2005 12:09:42 +, designer wrote: I've been having a little bother with validation of my PHP generated pages. I'm new to PHP/mySQL and I'm finding that some peculiar things happen, such as /body and /html appear in the middle of the code. (???) Also, I find that submitting a URL such as: $myurl=testdate.php?houseID=$housenamechangeID=$changeover; causes problems in that the generated pages don't validate: the ampersands seem to confuse the validator. Are these problems common, and is there somewhere I can find advice on such things? The ampersand problem is very common - basically you need to escape the ampersand to amp; (or one of the other choices). As a raw '', the browser is expecting there to be the rest of a character entity after it. The /body insertion is something else again - there must be a problem in your code, but its probably beyond the scope of this list :( warmly, Lea -- Lea de Groot Elysian Systems - http://elysiansystems.com/ Brisbane, Australia ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] CSS and PHP
Tim Burgan wrote: Just a quick note that'll help: In the URL, the special characters (such as ampersands, question marks, etc) need to be converted to html character entities. Question marks do not need to be converted. Regards -- Bert Doorn, Better Web Design http://www.betterwebdesign.com.au/ Fast-loading, user-friendly websites ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] CSS and PHP
Thank you Gentlemen, Very helpful as always! (I mean it!) -- Best Regards, Bob McClelland Cornwall (UK) www.gwelanmor-internet.co.uk ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] CSS and PHP
designer wrote: H All, I've been having a little bother with validation of my PHP generated pages. I'm new to PHP/mySQL and I'm finding that some peculiar things happen, such as /body and /html appear in the middle of the code. (???) Also, I find that submitting a URL such as: $myurl=testdate.php?houseID=$housenamechangeID=$changeover; A little bit off the beaten track: How about rewriting the URL to something more like housename/changeover?, so it's technologically independent, search engine friendly and validates easier? I'm currently mucking about with this and learning about this, after reading: http://www.w3.org/TR/chips/ http://www.w3.org/Provider/Style/URI Anyone who has done this before have any tips on this? Kat ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] CSS and PHP
Another issue: this may be caused by ussing sessions. When PHP manages sessions using GET queries as opposed to Cookies it might do this to your. What it does is appends PHPSESSION=w/e to the end of your urls, by default the is *not* escaped. There's a way (in php.ini I think) to fix it. Check http://php.net/session for details. Btw, I think talking about server side processing is kind of OT on this list, but if you have any more questions about PHP and such feel free to email me off-list. Alan Trick Bert Doorn wrote: Tim Burgan wrote: Just a quick note that'll help: In the URL, the special characters (such as ampersands, question marks, etc) need to be converted to html character entities. Question marks do not need to be converted. Regards ** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help **
Re: [WSG] CSS and PHP
Hi This has been discussed on the list before but the quick answer to URL's generated by PHP automatically (like its session handler) is to use ini_set(arg_separator.output, amp;);See : http://php.mirrors.ilisys.com.au/manual/en/ini.core.php#ini.arg-separator.outputIf you generate URL's manually using any script then it's up to the developer to insert amp; instead of ..Cheers JamesOn 11/15/05, Alan Trick [EMAIL PROTECTED] wrote: Another issue: this may be caused by ussing sessions. When PHP managessessions using GET queries as opposed to Cookies it might do this toyour. What it does is appends PHPSESSION=w/e to the end of your urls, by default the is *not* escaped. There's a way (in php.ini I think) tofix it. Check http://php.net/session for details.Btw, I think talking about server side processing is kind of OT on this list, but if you have any more questions about PHP and such feel free toemail me off-list.Alan TrickBert Doorn wrote: Tim Burgan wrote: Just a quick note that'll help: In the URL, the special characters (such as ampersands, question marks, etc) need to be converted to html character entities. Question marks do not need to be converted. Regards**The discussion list forhttp://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help**