Jump to content

empiresolutions

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by empiresolutions

  1. So i think i have found a working work-around for this. but i thinkit just that a work-around. If anyone can suggest a better method please let me know. [code]//File - /A/index.php or /B/index.php or /C/index.php <? include('whois.php'); include($GLOBALS['whois']."_starter.php"); ?> [/code] [code]//File - /includes/whois.php <? if ($_SERVER['SERVER_NAME'] == 'www.sitename.com' || substr($_SERVER['REQUEST_URI'],0,22) == '/clients/EmpireEngine/') {      $GLOBALS['whois'] = "es"; } ?> [/code]
  2. I will use a local linking stucture to illustrate my questions. You can read the forum titled "File Organization and Aliasing" for a larger picture of what im trying to accomplish. I have three folders living in /htdocs/ A(main site), B(admin), & C(shopping cart). Inside each folder are files that have at line 1, <?php include('es_starter.php') ?>. es_starter.php is in folder /htdocs/includes/, this file is manditory for the site to run. Since there are many starter.php files inside /includes/ i have added a site abbreviation to each (example.. *es_starter.php*). Each sites starter.php file is pathed by way of an updated *include_path* in php.ini. *A* is the main folded used on all sites. Inside of *A* is index.php. It has links to /B/index.php and /C/index.php. My question is how to get /B/index.php to properly call its site name abbreviated version of starter.php. I can not hard code in the site abbreviation because all files in /B/ and /C/ are supposed to be universal used by all domains. I have thought that i could set a $_COOKIE on /A/index.php [code] setcookie("site", "es", time()+60*60*24*1000, "/"); include($_COOKIE[site]."_starter.php"); [/code] that then gets read by all the other files, but deep linking will break this. I have also thought about reading the $_SERVER['SERVER_NAME'] variable then setting the abbreviation by that means but im not too sure. Any suggestions?
  3. My resolution was as follows, i am using a local example. This examples updates the location of the include path in the php.ini file. 1. Add a new directory, C:\apache2triad\htdocs\includes\. (You may also use an existing *include_path*) 2. Update *include_path* in php.ini file to also accept C:\apache2triad\htdocs\include\. The include_path will be looked in first when an *include()* is called from any file in localhost. It was that simple for the first part of my Question. The second can be found in a post called "Linking Structures".
  4. Hello all. I have been working on a Website/CMS (Engine) for a few years now. With every site i build, i just copy the current version of the Engine, make some minor changes and skin it to fit the perticular site i am building. This has worked well for a while. My problem is when i have to make an update. If i update or add an important feature to one site, usually i will need to add it to others that have the same Engine. So basically i have to waste a bunch of time updateing multiple site. I have since learned about aliasing. So i have now seperated all my Engine into three sperate parts. (1) Site Engine. This is all site dependent files for a basic site. (2) Cart Engine. These are all files dependent on the shopping cart. (3) Manager Engine. This is the CMS for the site. Before the seperation all files include() a *starter.php* file that initiates things like db connections, session control, and other various site dependent controls. My problem is now that i have seperated to three main Engines, only the Site Engine works. I had not forseen that the other two engines would now not have a way to connect, or know where the starter.php file is located. My question is how can i now tell the file */path/to/ManagerEngine/index.php* that at line #1 calls <? include("starter.php"); ?>, that the file is at */path/to/site.com/starter.php*. Ok I hope you all get what im asking. Thank you.
  5. i fixed it. simple pathing error. old - $file = "/upload/ITS_BLI_0".$_POST['id'].".csv"; new - $file = "../../upload/ITS_BLI_0".$_POST['id'].".csv";
  6. ftp_put() is not working. this is what i have. [code=php:0] $host = "www.site.com"; $ftp_user_name = "username"; $ftp_user_pass = "password"; // declair files $remote_file = "ITS_BLI_0".$_POST['id'].".csv"; // root level $file = "/upload/ITS_BLI_0".$_POST['id'].".csv"; // this file dir is root/manager/posts/ // connect to remote server $hostip = gethostbyname($host); $conn_id = ftp_connect($hostip); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // IMPORTANT!!! turn passive mode on ftp_pasv ( $conn_id, true ); if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $host for user $ftp_user_name"; die; } else { // upload a file if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo "successfully uploaded $file<br>"; } else { /** IM GETTING THIS ERROR **/ echo "There was a problem while uploading $file to $host<br>"; } // close the connection ftp_close($conn_id); } [/code] [list]I have done the following allready.[/list][list]Used both FTP_ASCII and FTP_BINARY in ftp_put().[/list][list]Passive mode must be on.[/list][list]I have tried ftp_fput().[/list] Is there a fix? Or maybe a way to view why its erroring on ftp_put(). thanks, [es]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.