Re: Works in html, not when echoed in PHP

From: Date: Wed, 13 Nov 2002 10:01:44 +0000
Subject: Re: Works in html, not when echoed in PHP
Groups: php.general 
Request: Send a blank email to php-general+get-124189@lists.php.net to get a copy of this message
rather than using echo why not just do this - ?> <body onload="start();initialize();onoff('mainmenu',section,'on')"
onresize="window.location.reload(false)" topmargin="1"     bottommargin="0" leftmargin="0" rightmargin="0">
?> this way you don't have to worry about getting the quotes right... Hello, "Aaron Merrick" <amerrick@mac.com> wrote:
Folks, Can't see an answer anywhere in the archives, so here goes. This works fine in plain html: <body onload="start();initialize();onoff('mainmenu',section,'on')" onresize="window.location.reload(false)" topmargin="1" bottommargin="0" leftmargin="0" rightmargin="0"> When I put it in PHP thus: echo "<body onload=\"start();initialize();onoff('mainmenu',section,'on')\" onresize=\"window.location.reload(false)\" topmargin=\"1\" bottommargin=\"0\" leftmargin=\"0\" rightmargin=\"0\">"; When the page loads, I get an "Error: 'menuObj' is null or not an object" The onoff() function is what contains the menuObj, so I suspect the single quotes around the parameters mainmenu and on, but have tried everyway I can
think of and can't get rid of the Error. The function is thus:
_________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail

« previous php.general (#124189) next »