Re: PHP scripts in HTML

From: Date: Wed, 14 Feb 2001 21:47:06 +0000
Subject: Re: PHP scripts in HTML
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39748@lists.php.net to get a copy of this message
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 >

« previous php.general (#39748) next »