editierbarer inhalt # beispiel: 50 ############# CONFIG ################################################################################### #define("E2E_PATH_ROOT","/home/www/web375/html/"); define("E2E_PATH_ROOT",realpath(dirname(__FILE__).'/../').'/'); define("E2E_URL_ROOT","http://www.thalhof.it/"); #define("E2E_PATH_ROOT","/mnt/development/0014_Hotel_Thalhof/Version_2_Relaunch_2005/version_0.1/"); #define("E2E_URL_ROOT","http://test.lan.peer.biz/0014_Hotel_Thalhof/Version_2_Relaunch_2005/version_0.1/"); $passwd = "c1b57f5ff788deba8dfeaf70f175cc8c"; # thalHof13 #$passwd = "82b875f0394b19cfe72a63e335d912c4"; #tmp admincucina $PHP_SELF = $_SERVER['PHP_SELF']; ############# OPTIONAL CONFIG ###################################################################### define("E2E_URL",URL_ROOT."easy2edit/"); $_popup_width = 600; $_popup_height = 550; ######################################################################################################## #### FUNC function user_logged_in() { global $_SESSION,$passwd; if($_SESSION[e2e_logged] AND $_SESSION[passwd]== $passwd) return true; } ######################################################################################################## #### MAKE CONFIG FORM AND OUTPUT if(strpos($PHP_SELF,"easy2edit") AND E2E_PATH_ROOT=="E2E_PATH_ROOT" AND !$_GET[e2e_action]) { ?>
E2E_PATH_ROOT: " size="100">

E2E_URL_ROOT: " size="100">

Passwort:

'; echo 'define("E2E_URL_ROOT","'.$_POST['E2E_URL_ROOT'].'");
'; echo '$passwd = "'.md5($_POST[passwd]).'";
'; exit; } ######################################################################################################## #### ACTION CASES switch($_GET[e2e_action]) { // speichern und seite neu laden case 'save' : if(!user_logged_in()) exit; $e2e_entry = explode("|",$_POST[e2e_id]); $filename = E2E_PATH_ROOT.$e2e_entry[1]; // read file $handle = fopen($filename, 'r'); $filecontent = fread($handle, filesize($filename)); fclose($handle); // alles bis zum bdo $filecontent_header = substr($filecontent,0,strpos($filecontent,"")); $filecontent_footer_tmp = substr($filecontent,strlen($filecontent_header)); $filecontent_footer = substr($filecontent_footer_tmp,strpos($filecontent_footer_tmp,"")); $filecontent_new = $filecontent_header."".$_POST[e2e_content].$filecontent_footer; // write file @chmod($filename,0777); if(!is_writable($filename)) echo "ACHTUNG! Die Datei $filename ist nicht schreibbar und die Attribute können nicht geändert werden"; else { $handle = fopen($filename, 'w'); fwrite($handle,$filecontent_new); fclose($handle); ?> * steht $handle = fopen($filename, 'r'); $filecontent = fread($handle, filesize($filename)); fclose($handle); // alles bis zum bdo $e2e_content_tmp = substr($filecontent,strpos($filecontent,"")); $e2e_content = substr($e2e_content_tmp,0,strpos($e2e_content_tmp,"")); $e2e_content = strtr($e2e_content,array(""=>"")); ?>

Password: