Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Does PHP have allow includes (just like javascript)

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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
imroue
New php-forum User
New php-forum User
 
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am

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

include "file.php";
require "file.php";
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

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
imroue
New php-forum User
New php-forum User
 
Posts: 62
Joined: Fri Oct 11, 2002 6:53 am

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

no :D

it is jast two . thare are more than two include function....
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron