sitesme Posted August 25, 2010 Share Posted August 25, 2010 Hi to all, I have a recent script that I asked. The programmer is gone (no reply) and since I need to move the script from the root of one hosting to another one inside a folder, it is giving always pointing all items such as images, CSS, etc. to the root and not to my 'inter' folder. I have the file definitions.php where I believe there is something I need to change here to make this work: <?php error_reporting(E_ALL); define('DB_USERNAME','xxx'); define('DB_PASSWORD','xxx'); define('DB_NAME','xxx'); ///// // Connect to DB ///// $db=mysql_connect('localhost',DB_USERNAME, DB_PASSWORD); mysql_select_db(DB_NAME, $db); while (list($glob) = each($GLOBALS)){ if (!preg_match('/^(_POST|_GET|_COOKIE|_SERVER|_FILES|GLOBALS|HTTP.*|_REQUEST)$/', $glob)){ unset($$glob); } } unset($glob); if(@get_magic_quotes_gpc()) unfck_gpc(); function unfck($v) { return is_array($v) ? array_map('unfck', $v) : stripslashes($v); } function unfck_gpc() { foreach (array('POST', 'GET', 'REQUEST', 'COOKIE') as $gpc){ $GLOBALS['_' . $gpc] = array_map('unfck', $GLOBALS['_' . $gpc]); } } if(empty($_SERVER['REQUEST_URI'])) $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; if(empty($_SERVER['REMOTE_ADDR'])) $_SERVER['REMOTE_ADDR'] = '0.0.0.0'; if(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR']; if(empty($_SERVER['REMOTE_HOST'])) $_SERVER['REMOTE_HOST'] = $_SERVER['REMOTE_ADDR']; if(empty($_SERVER['HTTP_REFERER'])) $_SERVER['HTTP_REFERER'] = ''; if(empty($_SERVER['HTTP_USER_AGENT'])) $_SERVER['HTTP_USER_AGENT'] = ''; ///// // User log in/out check ///// require_once('modules/system.php'); global $user, $errors, $content, $logger, $session; $serv_name = $_SERVER['SERVER_NAME'];; $serv_name=preg_replace('/^www\./si','',$serv_name); if(!empty($_COOKIE['cook']['session'])){ $session=$_COOKIE['cook']['session'];} else{ $session=md5(microtime()); setcookie('cook[session]',$session,0,'/',$serv_name); } $_POST['user_remember']=(empty($_POST['user_remember'])) ? 'false' : $_POST['user_remember']; if(!empty($_COOKIE['cook']['user_username'])&&!empty($_COOKIE['cook']['user_pass'])){ $user=check_user_login($_COOKIE['cook']['user_username'],$_COOKIE['cook']['user_pass'],'true','cook'); }elseif(!empty($_POST['user_username'])&&!empty($_POST['user_pass'])&&!$user['logged_in']){ $user=check_user_login($_POST['user_username'],md5($_POST['user_pass']),$_POST['user_remember'],'post'); } if((!empty($_POST['user_logout']) && ($_POST['user_logout']=='true'))||((!empty($_GET['act']))&&($_GET['act']=='logout')&&(empty($_POST['user_username'])))){ $user=user_logout(); header("Location: /"); exit(); } ?> Please let me know if you have a clue where do I need to add the 'inter' folder as I couldn't. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/211664-in-root-it-works-in-another-folder-it-doesnt/ Share on other sites More sharing options...
cliffdodger Posted August 26, 2010 Share Posted August 26, 2010 Well for starters did you copy over just the script itself or the directory the script was in and all subdirectories? It's obviously looking for a modules directory with system.php in it. Did you move that one over? Are the path variables in that file? Not knowing what this software is or does or how it was built makes it difficult to say but if the above doesn't help I'd take a guess that the content and the broken paths to images and css files might be stored in the database and you would have to go into your hosting control panel and access your database content via a graphical manager like phpmyadmin in order to see what's up. Quote Link to comment https://forums.phpfreaks.com/topic/211664-in-root-it-works-in-another-folder-it-doesnt/#findComment-1103751 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.