Re: [PLUG] Another PHP question.

Doug Crompton on 30 Mar 2007 17:33:04 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Another PHP question.


Ok... I did the following in a file called "test.html"
<html>
<head>
<title>test page</title>
</head>
<body>
this is a test
<?php
phpinfo();
include("page.html");
?>
this is another test
</body>
</html>
and the resultant output is
"this is a test this is another test"
If I make the file name "test.php" it includes the code.
Doug
On 2007年3月30日, Darian Anthony Patrick wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Doug Crompton wrote:
> > Since PHP is preprocessed by Apache and the filename (apparently) has to
> > be .php then why do I explicity have to put the PHP command in a
> > container?
>
> Because PHP is designed to easily co-exist inline with HTML, it assumes
> that the file contains HTML (or some other "static" output) which it
> should not touch, and does not enable PHP parsing until it encounters
> markers instructing it to do so.
>
> - --
> Darian Anthony Patrick
> Principal, Application Development
> Criticode LLC
> (215) 240-6566 Office
> (866) 789-2992 Facsimile
> Web: http://criticode.com
> Email: darian@criticode.com
> JID: darian@jabber.criticode.net
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGDUETKpzEXPWA4IcRAkuwAJ9ipGd8zhDuv426PRQNhgQms2qC9gCfQCOz
> GPLFPWzC2yMwOeW2/dU7FHs=
> =zCBz
> -----END PGP SIGNATURE-----
> ___________________________________________________________________________
> Philadelphia Linux Users Group -- http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
>
"Those that sacrifice essential liberty to obtain a little temporary safety
 deserve neither liberty nor safety." -- Ben Franklin (1759)
****************************
* Doug Crompton	 *
* Richboro, PA 18954	 *
* 215-431-6307		 *
*		 	 *
* doug@crompton.com *
* http://www.crompton.com *
****************************
___________________________________________________________________________
Philadelphia Linux Users Group -- http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug



AltStyle によって変換されたページ (->オリジナル) /