Jump to content
Larry Ullman's Book Forums

Question About Constants In Config.inc Script


Recommended Posts

Hello everyone. Thanks in advance for reading my post and any help.

 

I have a hosting account at godaddy.com

 

I have set up a directory to deploy my PHP websites.

 

// ************ CONSTANTS *********** //

 

// Determine location of files and the URL of the site:

define ('BASE_URI', '/path/to/dir/');

define ('BASE_URL', 'www.example.com/');

define ('PDFS_DIR', BASE_URI . 'pdfs/'); // Added in Chapter 5.

define ('MYSQL', BASE_URI . 'mysql.inc.php');

 

// ************ CONSTANTS *********** //

 

I need help making sure I declare the variables above correctly.

 

The directory I set up for my apps is:

 

http://www.newporttimesharesrus.com/webapps/

 

Inside of it I set up another directory: ecommerce:

 

http://www.newporttimesharesrus.com/webapps/eCommerce/

 

Inside of this directory are the directories for the application.

 

I put the PDFs directory inside the PHP Includes directory.

 

Base on the info above, what is the value for the BASE_URI constant and the other ones as well.

 

Thank you very much.

 

Jorge Muralles

Jorge@locopro.com

Link to comment
Share on other sites

Jorge, did I not already answer your question in my response to your PM?

 

Hi Stan. I never saw your answer.

 

Could you give the answer again.

 

Thank you very much.

 

I am wondering, I want to deploy a auctions website, that is why I am learning PHP and MySQL.

 

Do you know of a good script I can buy for this venture?

 

Thanks again.

 

Jorge Muralles

Link to comment
Share on other sites

Here's the copy and paste from my other message:

**********************************

 

BASE_URI refers to the base directory of your server, which should be outside the public HTML directory, and inaccessible from www.domain-name.com.

 

I can't tell you what string to use for the BASE_URI constant, as this is completely dependent on the hosting environment provided by your hosting company. Please contact them if you cannot figure this out on your own.

If you have some sort of control panel for your site though, it should be listed in there somewhere.

 

The BASE_URL constant is just the www.domain-name.com string. Obviously, domain-name needs to change to whatever the correct domain is.

 

The other two are based on the BASE_URI constant, but the idea is that there should be a directory called "pdfs" within the root directory of your server, and the MySQL script should also be in the base directory, so that both are inaccessible from the web.

 

That all make sense?

Also, in the future, please post your questions on the forum so that everyone can benefit from them.

Thanks.

Link to comment
Share on other sites

To answer your other question, I have heard of companies that make software packages for easily putting together e-commerce sites and shopping carts, though sadly, I cannot point you in a particular direction.

 

Perhaps Larry or someone else on here can offer more guidance.

Link to comment
Share on other sites

To answer your other question, I have heard of companies that make software packages for easily putting together e-commerce sites and shopping carts, though sadly, I cannot point you in a particular direction.

 

Perhaps Larry or someone else on here can offer more guidance.

 

Thank you very much.

Link to comment
Share on other sites

Here's the copy and paste from my other message:

**********************************

 

BASE_URI refers to the base directory of your server, which should be outside the public HTML directory, and inaccessible from www.domain-name.com.

 

I can't tell you what string to use for the BASE_URI constant, as this is completely dependent on the hosting environment provided by your hosting company. Please contact them if you cannot figure this out on your own.

If you have some sort of control panel for your site though, it should be listed in there somewhere.

 

The BASE_URL constant is just the www.domain-name.com string. Obviously, domain-name needs to change to whatever the correct domain is.

 

The other two are based on the BASE_URI constant, but the idea is that there should be a directory called "pdfs" within the root directory of your server, and the MySQL script should also be in the base directory, so that both are inaccessible from the web.

 

That all make sense?

Also, in the future, please post your questions on the forum so that everyone can benefit from them.

Thanks.

 

Thank you very much. I looked in my web hosting account control panel.

 

I have the absolute hosting path:

 

/home/content/68/10520168/html

 

www.newporttimesharesrs.com

 

Points to it.

 

Is this the info I need to create the constants.

 

Thank you very much.

 

Jorge Muralles

Link to comment
Share on other sites

Very likely /home/content/68/10520168/ is your server root, meaning that if you use an FTP client to log in to your server, you will be in the /home/content/68/10520168/ directory, and there will be a directory called html in that directory. That html directory is your web root, meaning that anything outside that directory is not accessible via the web.

 

That make sense?

Link to comment
Share on other sites

 Share

×
×
  • Create New...