Re: Works in html, not when echoed in PHP
| From: | Aaron Merrick | Date: | Wed, 13 Nov 2002 17:13:17 +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-124246@lists.php.net to get a copy of this message | ||
You are right, there is a reason I am echoing it in php, it is one result of
an if statement.
<?php if (basename($PHP_SELF) == "index.php") {
echo "<body
onload=\"start();initialize();onoff('mainmenu',section,'on')\"
onresize=\"window.location.reload(false)\" topmargin=\"1\"
bottommargin=\"0\" leftmargin=\"0\" rightmargin=\"0\">";
} else {
echo "<body
onload=\"initialize();onoff('mainmenu',section,'on')\"
onresize=\"window.location.reload(false)\" topmargin=\"1\"
bottommargin=\"0\" leftmargin=\"0\" rightmargin=\"0\">";
}
?>
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.
Anyway, I thought I would see if there were any more ideas as to what I am
doing wrong.
Thanks for the help,
Aaron
On 11/13/02 12:50 AM, "@ Edwin" <copperwalls@hotmail.com> wrote:
> echo '<body
> onload="start();initialize();onoff(\'mainmenu\',section,\'on\')"
> onresize="window.location.reload(false)" topmargin="1"
> bottommargin="0"
> leftmargin="0" rightmargin="0">';