how to insert a php file into a web page?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
garyed
Forum Newbie
Posts: 13
Joined: Fri Feb 20, 2009 6:45 pm

how to insert a php file into a web page?

Post 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?
tech603
Forum Commoner
Posts: 84
Joined: Thu Mar 19, 2009 12:27 am

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

Post 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
Post Reply