I am using a CMS gallery script Its working fine on my localhost but when I go put it on a regular folder I get the following message when I do to upload images wrong server url :main.php I dont know what the problem is I have tried to figure it out but no luck This is all the main.php code <?php define("PATH_CURRENT",dirname(__FILE__)); define("PATH_INC",PATH_CURRENT."/inc_php"); define("PATH_CONFIG",PATH_CURRENT."/config"); try{ require_once(PATH_INC."/"."functions_general.php"); require_once(PATH_CONFIG."/"."config.php"); require_once(PATH_INC."/"."defines.php"); require_once(PATH_INC."/"."functions.class.php"); require_once(PATH_INC."/"."system_config.php"); Functions::doStartupValidations(); //do some validations santizeAllRequests(); //sanitize get or post variables $action = getPostGetVariable("clientAction"); $fromObject = getPostGetVariable("fromObject"); //include login script: switch($action){ case "uploadfile": break; default: require_once "inc_cms/login.php"; break; } //images actions switch($action){ case "showimage": require_once(PATH_INC."/"."functions_imageview.php"); $filename = getPostGetVariable("img",""); $maxWidth = getPostGetVariable("w",-1); $maxHeight = getPostGetVariable("h",-1); $type = getPostGetVariable("t",""); showImage($filename,$maxWidth,$maxHeight); exit(); break; } require_once(PATH_INC."/"."functions_imageView.php"); require_once(PATH_INC."/"."functions_images.php"); require_once(PATH_INC."/"."functions_category.php"); require_once(PATH_INC."/"."functions_uploaded.php"); require_once(PATH_INC."/"."functions_items.php"); require_once(PATH_INC."/"."array2xml.class.php"); // GLOBALS: //create global $database createDatabaseGlobal(); //--------------------------------------------------------------------------------------------------- switch($action){ //============================ general actions ================================================ case "checkLogin": $user = getPostGetVariable("user"); $pass = getPostGetVariable("pass"); $response = checkLogin($user,$pass); showXml($response); break; case "getInitSettings": $response = getInitSettings(); showXml($response); break; case "getTemplatesList": $response = getTemplatesList(); showXml($response); break; //=============================== category actions ======================================================== case "addEmptyCategory": $response = addEmptyCategory(); showXml($response); break; case "addDefaultCategories": $response = addDefaultCategories(); showXml($response); break; case "addCategory": $categoryName = getPostVariable("categoryName"); $response = addCategory($categoryName); showXml($response); break; case "getCategoriesList": $response = getCategoriesList(); if(isset($_POST["actionAfter"])) $response["actionAfter"] = $_POST["actionAfter"]; showXml($response); break; case "deleteCategory": $categoryID = getPostVariable("categoryID"); $response = deleteAllCategoryItems($categoryID); if($response["success"] == false){ showXml($response); exit(); } $response = deleteCategory($categoryID); showXml($response); break; case "setCategoryOrder": $categoryID = getPostVariable("categoryID"); $targetCategoryID = getPostVariable("targetCategoryID"); $response = setCategoryOrder($categoryID,$targetCategoryID); showXml($response); break; case "deleteAllCategories": $response = $database->deleteTable(TABLE_CATEGORIES); showXml($response); break; case "saveCategoriesOrder": $strJsonOrders = $_POST["strJsonOrders"]; $arrCategoryOrders = getJsonObj($strJsonOrders); $response = setCategoryOrders_array($arrCategoryOrders); showXml($response); break; //=============================== upload actions ======================================================== case "deleteUploadedSelectedFiles": $strJsonFilenames = $_POST["strJsonFilenames"]; $arrFilesnames = getJsonObj($strJsonFilenames); $response = deleteUploadedSelectedFilenames($arrFilesnames); showXml($response); break; case "deleteAllUploadedFiles": $response = deleteAllUploadedFiles(); showXml($response); break; case "getUploadedFilesList": $response = getUploadedFilesList(); if(isset($_POST["actionAfter"])) $response["actionAfter"] = $_POST["actionAfter"]; showXml($response); break; case "getUploadedNumItems": $numItems = getUploadedNumItems(); $arrResponse = array("success"=>true,"numItems"=>$numItems); showXML($arrResponse); break; case "moveUploadedItemsToCategory": $strJsonFilenames = $_POST["strJsonFilenames"]; $arrFilenames = getJsonObj($strJsonFilenames); $categoryID = $_POST["categoryID"]; $autoDeleteWrongType = (Boolean)$_POST["autoDeleteWrongType"]; $response = moveUploadedItemsToCategory($arrFilenames,$categoryID,$autoDeleteWrongType); updateCategoryNumItems($categoryID); showXML($response); break; case "moveAllUploadedItemsToCategory": $categoryID = getPostGetVariable("categoryID",""); $response = moveAllUploadedItemsToCategory($categoryID); updateCategoryNumItems($categoryID); showXML($response); break; case "uploadfile": treatUploadedFile(); break; //--------------------------- Items -------------------------------- case "getCategoryItems": $categoryID = $_POST["categoryID"]; $response = getCategoryItems($categoryID); showXml($response); break; case "getCategoryItemsOthers": //get list of category items that not listed in current items. $categoryID = $_POST["categoryID"]; $strCurrentItems = $_POST["strCurrentItems"]; $response = getCategoryItems_diff($categoryID,$strCurrentItems); showXml($response); break; case "getCategoryItemsRemoved": $categoryID = $_POST["categoryID"]; $strCurrentItems = $_POST["strCurrentItems"]; $response = getArrRemovedItemIDs($categoryID,$strCurrentItems); showXml($response); break; case "setItemsOrder": $strJsonItems = $_POST["strJsonItems"]; $arrItems = getJsonObj($strJsonItems); $response = setItemsOrder($arrItems); showXml($response); break; case "deleteCategoryItems": $strItemIDs = $_POST["strItemIDs"]; $categoryID = $_POST["categoryID"]; $strItemIDs = trim($strItemIDs); if($strItemIDs == "") $arrItemIDs = array(); else $arrItemIDs = explode(",",$strItemIDs); $response = deleteItems($arrItemIDs); $response["categoryID"] = $categoryID; updateCategoryNumItems($categoryID); showXml($response); break; case "updateItem": $itemID = $_POST["itemID"]; $itemName = $_POST["itemName"]; $itemDesc = $_POST["itemDesc"]; $itemLink = $_POST["itemLink"]; $response = updateItem($itemID,$itemName,$itemDesc,$itemLink); showXml($response); break; case "updateCategory": $catID = $_POST["id"]; $catName = $_POST["title"]; $catDesc = $_POST["catDesc"]; $catLongDesc = $_POST["longDesc"]; $response = updateCategory($catID,$catName,$catDesc,$catLongDesc); showXml($response); break; case "copyItemsToCategory": $strSelectedItems = $_POST["strSelectedItems"]; $categoryID = $_POST["categoryID"]; if($strSelectedItems == "") $response = errorResponse("No items found"); else { $arrItems = explode(",",$strSelectedItems); $response = copyItemsToCategory($arrItems,$categoryID); if($response["success"] == true) updateCategoryNumItems($categoryID); } showXml($response); break; case "moveItemsToCategory": $strSelectedItems = $_POST["strSelectedItems"]; $categoryID = $_POST["categoryID"]; if($strSelectedItems == "") $response = errorResponse("No items found"); else { $arrItems = explode(",",$strSelectedItems); $response = moveItemsToCategory($arrItems,$categoryID); updateCategoriesNumItems(); } showXml($response); break; case "duplicateItem": $categoryID = $_POST["categoryID"]; $itemID = $_POST["itemID"]; $response = copyItemToCategory($itemID,$categoryID,"duplicate"); if($response["success"] == true){ updateCategoryNumItems($categoryID); } showXml($response); break; case "downloadItem": $itemID = getPostGetVariable("itemID"); downloadItem($itemID); break; //--------- templates functions -------------------- case "addTemplate": $title = $_POST["dialogTitle"]; $text = $_POST["dialogText"]; $response = addNewTempalte($title,$text); showXml($response); break; case "removeTemplate": $templateID = $_POST["templateID"]; $response = removeTemplate($templateID); showXml($response); break; case "saveTemplateData": $templateID = $_POST["templateID"]; $templateData = $_POST["templateData"]; $response = updateTemplate($templateID,array("data"=>$templateData)); showXml($response); break; case "updateTemplateTitle": $templateID = $_POST["templateID"]; $templateTitle = $_POST["templateTitle"]; $response = updateTemplate($templateID,array("title"=>$templateTitle)); showXml($response); break; case "test": downloadItem(10); //addItem_image("D:/xampp/htdocs/activeden/admin/main/dev/upload/5.jpg","image1.jpg",2); break; default: showXml(errorResponse("wrong action: $action")); break; } }catch(Exception $e) { $response = errorResponse($e->getMessage()); showXml($response); exit(); } ?> PHP: and this is the gallery.php file <?php define("PATH_CURRENT",dirname(__FILE__)); define("PATH_INC",PATH_CURRENT."/inc_php"); define("PATH_CONFIG",PATH_CURRENT."/config"); try{ include(PATH_INC."/"."functions_general.php"); require_once(PATH_CONFIG."/"."config.php"); require_once(PATH_INC."/"."defines.php"); require_once(PATH_INC."/"."functions.class.php"); require_once(PATH_INC."/"."system_config.php"); Functions::doStartupValidations(); //do some validations require_once(PATH_INC."/"."functions_imageview.php"); santizeAllRequests(); $action = getPostGetVariable("clientAction"); if($action == "") $action = getPostGetVariable("action"); if($action == "" && getPostGetVariable("img","") != "") $action = "showimage"; //images actions switch($action){ case "showimage": $filename = getPostGetVariable("img",""); $maxWidth = getPostGetVariable("w",-1); $maxHeight = getPostGetVariable("h",-1); $type = getPostGetVariable("t",""); showImage($filename,$maxWidth,$maxHeight,$type); exit(); break; case "download": $filename = $_GET["img"]; downloadImage($filename); exit(); break; } $g_provider = getPostGetVariable("provider","json"); $templateID = getPostGetVariable("templateid",""); $templateTitle = getPostGetVariable("template",""); if($action == "" && ($templateID != "" || $templateTitle != "")) $action = "getParsedTemplate"; include(PATH_INC."/"."functions_images.php"); include(PATH_INC."/"."functions_category.php"); include(PATH_INC."/"."functions_uploaded.php"); include(PATH_INC."/"."functions_items.php"); include(PATH_INC."/"."settings.class.php"); include(PATH_INC."/"."advanced_settings.class.php"); include(PATH_INC."/"."functions_gallery.php"); include(PATH_INC."/"."array2xml.class.php"); // GLOBALS: //create global $database createDatabaseGlobal(); //set the g_settings require_once "inc_cms/page_settings.php"; //--------------------------------------------------------- //filter categories list with certain fields function filterCategoriesList($categories){ $fields = array("id","name","catDesc","longDesc","numItems"); foreach($categories as $key => $category) $categories[$key] = Functions::filterArrFields($category,$fields); return($categories); } //--------------------------------------------------------- switch(strtolower($action)){ case "": case "getdata": $response = getAllGalleryData(); output($response,true); break; case "getcss": include(PATH_INC."/"."gallery_css_output.class.php"); $settings = $g_settings->getArrSavedSettings(); $css = new GalleryCssOutput(); $css->setSettings($settings); $css->putCSS(); break; case "getcategories": $response = getCategoriesList(); $categories = filterCategoriesList($response["categories"]); output($categories,true); break; default: $response = errorResponse("wrong action: ".$action); output($response); break; } }catch(Exception $e) { $response = errorResponse($e->getMessage()); output($response); exit(); } ?> PHP: Is it having problems picking up the data base?
no idea, can't find the part where wrong server url is writen please search for that part.. and where's the config? i think there should be a fault at this point.