CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> PHP

 change relative path to absolute path in codecharge php project

Print topic Send  topic

Author Message

Posts: 3
Posted: 05/21/2013, 9:53 AM

I have the following problem. At the time we built a php application with CodeCharge 4 which was hosted on a linux development server, where through a subdomain folder referenced to the web application was displayed ..

When we are installing at the customer, he has a windows server (on which is installed Apache, php and mysql with the same versions). The issue is as follows:

- For domestic policy, this customer has a subdomain that points to a location as document root in Apache (eg c :/ www) which displays all the web of suppliers. This gives you a structure:
C :/ www/ application1
C :/ www / application 2

The issue is that when we installed our web, we placed on this structure, but as the subdomain points to the root, when we put in the browser "subdomain / application", as the files generated by CodeCharge has the relative path (".") , Apache tries to find the file in the root of the subdomain and gives a file not found error.

The only way I see is to change all relative paths to make them absolute. which is a Chinese work.

Any idea?
View profile  Send private message

Posts: 220
Posted: 05/21/2013, 10:06 AM


I solve this problem by having a "settings" DB table where I store (and later retrieve) values that I need.

For example my sites have structure like:

For server side /public_html/some_folder/some_subfolder/application_folder/
For this site I have sub-domain defined as:
And the sub-domain points to "application_folder".

This setup on server allows me to have for example multiple applications in multiple versions, as well as development sites, test sites and production sites.

But anyway, I solved this by:

- having DB table with setting - value pairs
- creating a helper function for CCS:

function CCDGetSetting($setting_name, &$db)  
  $sql = "SELECT setting_val FROM settings WHERE setting_key = " . $db->ToSQL($setting_name, ccsText);  
  return CCGetDBValue($sql, $db);  

- in the settings table I have names for all folders and when needed I use CCDGetSetting() to retrieve them
- I also store domain and subdomain names
- generally I store all settings in that table ;-)

This makes application flexible and allows to have different paths on different machines, sites, applications and so on...
View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Internet Database

Visually create Web enabled database applications in minutes.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.