Re: Works in html, not when echoed in PHP

From: Date: Wed, 13 Nov 2002 18:08:13 +0000
Subject: Re: Works in html, not when echoed in PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-124264@lists.php.net to get a copy of this message
"Aaron Merrick" <amerrick@mac.com> wrote: > You are right, there is a reason I am echoing it in php, it is one result of > an if statement. Well, I thought so :) ...[snip]... > I tried echoing with single quotes - no change. So I compared the view > source of the double quoted php generated page and of the html generated > page - they are identical: > > <body > onload="start();initialize();onoff('mainmenu',section,'on')" > onresize="window.location.reload(false)" topmargin="1" > bottommargin="0" > leftmargin="0" rightmargin="0"> > > So I no longer think php is parsing the javascript incorrectly - the same > error happens if I put the 'onoff()' function directly in html and only put > the 'start()' function in the if statement. The weird thing is that the php > page still gives the error and the html does not. I can only guess... What happens when you take out the start() then? I think it'd be a good idea anyway to take away the js codes in your <body> tag (also the xxxmargin stuffs) since your page wouldn't actually validate as valid xhtml (if you're concerned of course...). Is it not possible to put those inside the <head> tags, in-between <script> tags? - E

« previous php.general (#124264) next »