Koozali.org: home of the SME Server

Help needed in placiing files on sme server to keep some sme linux standards

Offline purvis

  • ****
  • 567
  • +0/-0
So far, i have only placed a few php script files of my own on a sme server.
But now is the time when i need to think about where to place certain files to keep some standard with sme linux.
First, I need to place some php shared files on the server where other files can have global server access to those files and really it could be any kind of file(s) other than php files.
Second, I have also had some problems in my scripts of identifying location of files which i though would be simple using standard php functions.

First
I am using some php scripts and other files with those php scripts from FPDF to create pdf files from a web page on sme server.
So far, i have located those files under an ibay/files/ directory where the web page php files exist under /ibay/html/ directory.
Doing this will not have flexiblity in where the php web page files are located, at least that would be my first thought if i put them there.

So i am asking you professionals where is the most likely best place for files to be placed for access in a global manner. It would even be nice if they where placed in a directory that was searched when the files as referenced in a php script? Also maybe a some places where never to place files would be good as well.
 

Second, Because php is such a popular web page scripting language.  Are there some standard functions that will retrieve file locations, ibay locations, etc or do i have to write my own like the below to acquire these locations.
Code: [Select]
<?php
$ssmeibays
="/home/e-smith/files/ibays/";
$sscriptnamewithfullpath$_SERVER["SCRIPT_FILENAME"];
$sscriptnameonly=basename($sscriptnamewithfullpath);
$atemppreg_split("[/]"$_SERVER["SCRIPT_NAME"]);
$sibaynameonly=$atemp[1];
$sscriptnamewithibay=str_replace($ssmeibays,"",$sscriptnamewithfullpath);
$sibaynamewithfullpath=(str_replace($sscriptnamewithibay,"",$sscriptnamewithfullpath)).$sibaynameonly."/";
$sscriptnamefullpath=str_replace($sscriptnameonly,"",$sscriptnamewithfullpath);

echo 
"<html>";
echo 
"<HEAD><TITLE>Testing creation of directory values with php</TITLE></HEAD>";

echo 
"<body><h3>";

echo 
"script name with full path = ".$sscriptnamewithfullpath;
echo 
"<p>";
echo 
"full path to script name   = ".$sscriptnamefullpath;
echo 
"<p>";
echo 
"script name only = ".$sscriptnameonly;
echo 
"<p>";
echo 
"script name from ibay = ".$sscriptnamewithibay;
echo 
"<p>";
echo 
"ibay name only where script name is located = ".$sibaynameonly;
echo 
"<p>";
echo 
"ibay name with full path = ".$sibaynamewithfullpath;
echo 
"<p>";
echo 
"</body></html>";
?>


One piece of programming i am doing is to convert a web page form to a pdf form for printing using FPDF php scripting.
http://www.somacon.com/p456.php
here is the example web page with the  code i am working from
i do have it working on my sme server and i do not mind sharing what i have done to convert the code over for running with sme server if it all right with the source created which it appears by reading thru the docs on that webpage it is ok, but i am still hesitant.



« Last Edit: November 04, 2010, 12:19:20 AM by purvis »