Does PHP have allow includes (just like javascript)

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am
Contact:

Does PHP have allow includes (just like javascript)

Postby imroue » Sat Nov 16, 2002 9:27 pm

In javascript you can include this code:

Code: Select all

<SCRIPT language="javascript" src="functions.js"></SCRIPT>

and the page you are on will use that file for variables, functions..etc..

Is there a way to do this for PHP?
I want to use a seperate file to put all the constants for my page.
That way i only modify the constants on one page as apposed to 10 diff php files.

Is this possible?
:?: :?:

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Sat Nov 16, 2002 10:41 pm

include "file.php";
require "file.php";

User avatar
imroue
New php-forum User
New php-forum User
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am
Contact:

Postby imroue » Sat Nov 16, 2002 11:15 pm

Pejone wrote:include "file.php";
require "file.php";


THANKS FOR THE REPLY,

Are they BOTH required to be there?

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Sun Nov 17, 2002 1:19 am

no :D

it is jast two . thare are more than two include function....


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 3 guests

cron