FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Autotomatically resolve base/root path for Formtools
#1
Just a suggestion:

In the Formtools main config.php file, use the following(?) to define $g_root_url and $g_root_dir:

PHP Code:
$g_root_url  = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" "http");
$g_root_url .= "://".$_SERVER['HTTP_HOST'];
$g_root_url .= str_replace("/global/".basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);

$g_root_dir  $_SERVER['DOCUMENT_ROOT'];
$g_root_dir .= str_replace("/global/".basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); 

I can't remember how these are defined by default but the above snippet will automatically calculate both the base and root paths for FormTools (you could even go as far as excluding it from the config file altogether and place it in the core).

I've used something similar before on Codeigniter and thought it may prove useful for future releases, Ben.
Reply


Messages In This Thread
Autotomatically resolve base/root path for Formtools - by crunchers - May 5th, 2011, 8:33 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)