Re: javascript label inside php code.
| From: | dcoleman | Date: | Thu, 21 Jun 2001 15:26:09 +0000 |
| Subject: | Re: javascript label inside php code. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-54751@lists.php.net to get a copy of this message | ||
Sure, try this
// ?>
echo('
<script language="JavaScript">
<!-- This script controls the rollovers in the menu area
if (document.images) {
');
// <?
Make sure there are no blanks _anywhere_ (even in includes) before the header code
HTH
Andrew Austin wrote:
> Warning: Cannot add header information - headers already sent by (output started
> I understand that one of the reasons for this erro message is if their is a trailing space
> after a ?>. I have some PHP code which produces javascript rollover code. Above this there are a
> few includes referencing database and authorization files. Then I there is this peice of code
>
> finish of start code
> <?
> $page=getenv(SCRIPT_NAME) ;
> $page = split( "/", $page, 3 );
> $page = "." . $page[4];
> $page = split( "\.", $page, 2);
> $page = $page[1];
> ?>
> <script language="JavaScript">
> <!-- This script controls the rollovers in the menu area
> if (document.images) {
> <?
>
> etc etc start of next code
>
>
> It is this break which produces the error code. Is it possible to place the <script
> language="JavaScript"> into a piece of php code to fix this error? Or is there another
> method?
>
> Thanks in advance.
>
> Andrew
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net