Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PHP] Print in html <?

0 views
Skip to first unread message

Brandon Orther

unread,
Feb 21, 2001, 1:35:25 PM2/21/01
to
Hello,

I am trying to finish up a script with instructions on how to add my banner
add script to someone's .phtml file. I need to print <? readfile(""); ?> in
the html page that has instructions for the user. Anyway when I try to do
that it just runs as a script... does anyone know how I can get over this?

Thank you,

--------------------------------------------
Brandon Orther
WebIntellects Design/Development Manager
bra...@webintellects.com
800-994-6364
www.webintellects.com
--------------------------------------------


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general...@lists.php.net
For additional commands, e-mail: php-gene...@lists.php.net
To contact the list administrators, e-mail: php-lis...@lists.php.net

Christian Reiniger

unread,
Feb 22, 2001, 5:41:48 AM2/22/01
to
On Wednesday 21 February 2001 20:11, Hrishi wrote:

> On Thursday 22 February 2001 00:12, Brandon Orther wrote:
> > Hello,
> >
> > I am trying to finish up a script with instructions on how to add my
> > banner add script to someone's .phtml file. I need to print <?
> > readfile(""); ?>
>
> use :
> echo '<? yaddayadda ?>';
>
> the single quotes ensure that php does not evaluate the contents of the
> string constant

=> it is sent as is, the browser sees a tag that's unknown to him and
simply ignores it. I.e. that doesn't work.

Use the proper HTML entities for the brackets:

&lt;? readfile (""); ?&gt;

--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

I saw God --------- and she was black.

PHPBeginner.com

unread,
Feb 22, 2001, 6:08:29 AM2/22/01
to
if it is in html then do this:

&lt;?

but if you are using PHP then echo '<?' will work perfectly.


Sincerely,

Maxim Maletsky
Founder, Chief Developer

PHPBeginner.com (Where PHP Begins)
ma...@phpbeginner.com
www.phpbeginner.com

PHPBeginner.com

unread,
Feb 22, 2001, 6:08:30 AM2/22/01
to
However I think double quote will work as well... (am I wrong?)


Sincerely,

Maxim Maletsky
Founder, Chief Developer

PHPBeginner.com (Where PHP Begins)
ma...@phpbeginner.com
www.phpbeginner.com

-----Original Message-----
From: Hrishi [mailto:hri...@mediaibc.com]
Sent: Thursday, February 22, 2001 4:12 AM
To: Brandon Orther; PHP User Group
Subject: Re: [PHP] Print in html <?


On Thursday 22 February 2001 00:12, Brandon Orther wrote:

> Hello,
>
> I am trying to finish up a script with instructions on how to add my
banner
> add script to someone's .phtml file. I need to print <? readfile(""); ?>

use :
echo '<? yaddayadda ?>';

the single quotes ensure that php does not evaluate the contents of the
string constant

cheers,
hrishi

Sascha Andres

unread,
Feb 21, 2001, 3:06:41 PM2/21/01
to
hi,
with

?>
&lt;? readfile(""); ?&gt;
<?

it should run. u could use

echo ("< readfile(\"\")>")

as well.

sascha

Hrishi

unread,
Feb 21, 2001, 2:05:47 PM2/21/01
to
On Thursday 22 February 2001 00:12, Brandon Orther wrote:
> Hello,
>
> I am trying to finish up a script with instructions on how to add my banner
> add script to someone's .phtml file. I need to print <? readfile(""); ?>

use :
echo '<? yaddayadda ?>';

the single quotes ensure that php does not evaluate the contents of the
string constant

cheers,
hrishi

--

Christian Reiniger

unread,
Feb 22, 2001, 9:50:21 AM2/22/01
to
On Thursday 22 February 2001 12:14, PHPBeginner.com wrote:
> if it is in html then do this:
>
> &lt;?
>
> but if you are using PHP then echo '<?' will work perfectly.

No.
echo '<?' will ensure that the stuff is not parsed, but the browser will
not evaluate it (unknown tags are ignored). So &lt; or echo '&lt;' is
needed.

--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Drink wet cement. Get stoned.

0 new messages