Welcome! Log In Create A New Profile

Advanced

Includes directories

Posted by Kayc78145228 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Includes directories
September 11, 2013 01:31PM
Hi Prof

1) We are creating a SINGLE config file and put it in the includes directory (includes/config.php).

2) If we use functions, they must be included in the directory (include/functions.php).

The two directories are different (includes and include), i need your confirmation on this. I ask because i dont want the application to fall over and fail to find relevent files when you unzip it onto your server.
Please confirm if the directories are the same or two different directories.
avatar Re: Includes directories
September 11, 2013 04:37PM
Rather put the config.php and function.php in the same folder. Be it include or includes. The app will still work if it is in different folders, you then have to put this at the top of each page:

Language: PHP
include ("includes/config.php"); include ("include/func.php");

So it is much better to have it like this:

Language: PHP
require ("include/config.php"); include ("include/func.php");

___________________________________________________________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning...
avatar
Mac
Re: Includes directories
September 12, 2013 08:20AM
Is there a typo in the tut letter? Yes, one directory.
Re: Includes directories
September 12, 2013 08:56AM
I got it, thanx guys. I needed clarity.
Sorry, only registered users may post in this forum.

Click here to login