RE: [PHP] PHP scripts in HTML
| From: | Brian V Bonini | Date: | Wed, 14 Feb 2001 22:22:23 +0000 |
| Subject: | RE: [PHP] PHP scripts in HTML | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39761@lists.php.net to get a copy of this message | ||
Don,
Why don't you just rename your .html file
to .php and use 'include' to call an external
php script.
-brian
*********
> -----Original Message-----
> From: Scott Mebberson [mailto:scott@redbluedesign.com]
> Sent: Wednesday, February 14, 2001 4:47 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] PHP scripts in HTML
>
>
> Hi Don,
>
> This wont work as PHP is a server side scripting language. So by the time
> your page gets displayed in a browser, php has already packed up and gone
> home. It has done it's job and exited your page.
>
> For your webserver to recognise php it must be incompessed in
> <?php ?> tags,
> or <? ?>. This is so your webserver knows when to start up php (so to
> speak).
>
> Inserting the <script...> statement like you did is to late,
> because all of
> the information has already be passed to the browser and php
> can't write any
> more information to the page.
>
> Hope this helps.
>
>
> "Don" <don@lclcan.com> wrote in message
> news:3A8AF881.D6F3406F@lclcan.com...
> > I would like to know if there is a way to accomplish the following:
> > In my HTML file, I have the following:
> >
> > <script language="php"
> > src="/phpscript/testscript.php"></script>
> >
> > In the testscript.php file, I have:
> >
> > <?PHP
> > echo "Hello Don";
> > echo "What is up?";
> > ?>
> >
> > When I run the html file, I do not see the PHP code but if I place the
> > above code directly in my HTML file, it displays.
> >
> >
> > --
> > 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
> >
>
>
>
> --
> 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
>
>