Page 1 of 1

how to insert a php file into a web page?

Posted: Fri Mar 27, 2009 7:20 pm
by garyed
This may sound stupid but I've gotta ask.
I have a php file I use to log in the date and time anyone visits my web page.
It actually works O.K. but I load it the same way I do a javascript file.
In the header I use:
[code:] <script language="javascript"> src="file.php "</script>
Is there a better way or since it works is this as good as any?

Re: how to insert a php file into a web page?

Posted: Fri Mar 27, 2009 7:41 pm
by tech603
You can do an include.

include_once('file.php');

Here are the links that will help you out
http://www.php.net/manual/en/function.include.php
http://www.php.net/manual/en/function.include-once.php