Re: [PHP] Re: Echoing HTML in PHP as CGI

2002-09-26 Thread Reuben D. Budiardja

Thanks.
This is what i was looking for. I remember reading something about this but 
just didn't remember where.

Rdb.

On Thursday September 26 2002 03:42 pm, Martin W Jørgensen wrote:
> You can use this code:
>
> print <<< EndOfHTML
>
> put all html in here even with "
>
> EndOfHTML;
>
> This will print out all html. and dont care about special signs.
>
> goodluck.
> Martin
>
> "Reuben D. Budiardja" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
> When using Apache web server, with php module, I can intermix between HTML
> code and PHP. But when using PHP as CGI (in other web server, eg. OMNI), as
> far as I know, I have to write all HTML code using either echo or print
> statement, right? Is there a better way to do this?
>
> The problem is that someone already have the HTML part, and I just wont to
> insert some PHP codes around it. If I use
> echo "
> [HTML CODE] ";
>
> then I have to escape all the quotation mark (") inside the HTML code,
> which is laborious and not really elegant. The same problem occurs even if
> I use echo with single quote instead of double quote. I have to escape all
> the single quote, since the HTML code is also intermix between HTML and
> javascript, which has single and double quotes.
>
> How do I best solve this problem? Thanks a lot for any response.
> Reuben D. Budiardja


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Echoing HTML in PHP as CGI

2002-09-26 Thread Martin W Jørgensen

You can use this code:

print <<< EndOfHTML

put all html in here even with "

EndOfHTML;

This will print out all html. and dont care about special signs.

goodluck.
Martin

"Reuben D. Budiardja" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi all,
When using Apache web server, with php module, I can intermix between HTML
code and PHP. But when using PHP as CGI (in other web server, eg. OMNI), as
far as I know, I have to write all HTML code using either echo or print
statement, right? Is there a better way to do this?

The problem is that someone already have the HTML part, and I just wont to
insert some PHP codes around it. If I use
echo "
[HTML CODE] ";

then I have to escape all the quotation mark (") inside the HTML code, which
is laborious and not really elegant. The same problem occurs even if I use
echo with single quote instead of double quote. I have to escape all the
single quote, since the HTML code is also intermix between HTML and
javascript, which has single and double quotes.

How do I best solve this problem? Thanks a lot for any response.
Reuben D. Budiardja



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php