Jump to content
xisto Community
Sign in to follow this  
itssami

Some Php Functions Explaination Required

Recommended Posts

Can some one please tell me what is the purpose of the following functions , although there's a little explaination with everyline but i cant understand, can some one exaplin it bit clearly and tell me that why it is needed in config.inc.php.. what is its purpose and will it work if i dont include these files in config.inc.php
thanks

### Url were Website has been installed, not '/' in end!define('C_URL','https://www.test.com/');

### Internal path to Website directory
define('C_PATH','Z:/home/https://www.test.com/;);

### Site Name
define('C_SNAME','MyWebsiteName');


Share this post


Link to post
Share on other sites

what is its purpose and will it work if i dont include these files in config.inc.phpthanks


A 'config' file is one which contains information about the 'set-up' or the 'configuration' used for the cript or application. In the file you reference, the config information has to do with the source of the files for the application and the paths to those files which will be required for the script to operate properly and see all the data it need to and direct the user to the correct spot as they select . Without seeing the exact script you are talking about, it is difficult to know exactly what these defined constants do, but a pretty good guess would be that , yes, they will be required for the script to be able to do what you want.

### Url were Website has been installed, not '/' in end!define('C_URL','https://www.test.com/');

### Internal path to Website directory
define('C_PATH','Z:/home/https://www.test.com/;);

### Site Name
define('C_SNAME','MyWebsiteName');

They are pretty much explained by the comments included with the defines, so no need to outline what they do here. Someplace in the script, they would be used to identify paths to files on the server and the Web address for the site. They are defined outside the actual script for several reasons. First of all, so that one file can be 'required' by all scripts on the site and the data only needs to be changed in one location. Secondly, the 'defined' values can't be altered by accident inside the script whereas regular variables can be changed by methods like assignment statements (='s), but defined constants can not be, so they are safer.
Thirdly, having these 'defines' available makes the script 'portable'. They can be installed anywhere in the file or folder structure of your site and not be concerned about referencing from the server root, since the path is declared in the config file.

So, to answer your question, I would have the config file set-up and required_once in each of the scripts which need them to assure there are no difficulties. Also, the 'C_URL' and C_PATH' are Windows references right now. In order to upload them and use on the Xisto server, you will have to change them to Apache/Linux references.

Share this post


Link to post
Share on other sites

I presume you are installing a forum or suchlike? This information is needed to allow the pages to call other scripts, save information in other files and stuff like that. For the first one enter your web address, where the script is stored. For example [colour=blue]http://forums.xisto.com/no_longer_exists/]. The next one is mainly used for accessing files, and you can get it from looking in cPanel. The last one looks like it should just be the 'friendly' name for your site. Try looking in the installation help files for more information.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.