Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Some Php Functions Explaination Required
itssami
post Apr 2 2006, 02:25 PM
Post #1


Super Member
*********

Group: Members
Posts: 258
Joined: 13-November 05
Member No.: 14,234



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

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

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

### Site Name
define('C_SNAME','MyWebsiteName');
Go to the top of the page
 
+Quote Post
jlhaslip
post Apr 2 2006, 02:49 PM
Post #2


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 3,994
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



QUOTE(itssami @ Apr 2 2006, 08:25 AM) *

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


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.
QUOTE

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

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

### 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 trap17 server, you will have to change them to Apache/Linux references.

Go to the top of the page
 
+Quote Post
rvalkass
post Apr 2 2006, 02:49 PM
Post #3


apt-get moo
Group Icon

Group: [MODERATOR]
Posts: 2,114
Joined: 28-May 05
From: Hertfordshire, England
Member No.: 7,593
Spam Patrol



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://www.username.trap17.com/Website[/color]. 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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Writing Your Own Functions In Php(2)
  2. Using The Image Editing Functions Of Php(4)
  3. Personal Blog(4)
  4. Globals Inside Functions(4)
  5. Php Code Fix Required(3)
  6. Wappy's Php Snippets(13)
  7. Gd Functions(2)
  8. Files Required?(5)
  9. How To Delete A Row In Mysql.(4)
  10. [php](simple) Using Functions To Combine Values In A Form(2)
  11. Encrypt Functions(0)
  12. What Coding Languages Are Required?(5)
  13. Making Sure They Did Not Leave Any Required Fields Blank(3)
  14. Arrays Outside A Function(3)
  15. Php Functions To Send Mail(9)
  1. Php Email Validation(1)
  2. Script Help Required: Undefined Variable(3)
  3. Functions(8)


 



- Lo-Fi Version Time is now: 6th September 2008 - 05:06 PM