cvs: php-hosts-web /clients host-services-edit.php

From: Date: Sun, 21 Apr 2002 22:17:58 +0000
Subject: cvs: php-hosts-web /clients host-services-edit.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-9729@lists.php.net to get a copy of this message
jimw Sun Apr 21 18:17:58 2002 EDT Modified files: /php-hosts-web/clients host-services-edit.php Log: store values in db instead of filesystem Index: php-hosts-web/clients/host-services-edit.php diff -u php-hosts-web/clients/host-services-edit.php:1.2 php-hosts-web/clients/host-services-edit.php:1.3 --- php-hosts-web/clients/host-services-edit.php:1.2 Sun Apr 21 15:35:52 2002 +++ php-hosts-web/clients/host-services-edit.php Sun Apr 21 18:17:58 2002 @@ -11,8 +11,6 @@ if ($MODE=="EDIT") { unset($querys); - unset($files); - unset($filedel); while (list(,$serviceid)=each($sid)) { @@ -72,14 +70,10 @@ } break; case "free": - $file = $DESC_DIR . "/h" . $hostid . "s" . $serviceid; - if (file_exists($file)) { - $filedel[] = $file; - } if ($value) { $value2 = substr(addslashes($value),0,30) . "..."; $querys[] = "insert into $HOST_SERVICES_TABLE (HostID,ServiceID,OptionValue) values ($hostid,$serviceid,'$value2')"; - $files[$file] = $value; + $querys[] = "replace into host_value (HostID,ServiceID,content) values ($hostid,$serviceid,'$value')"; } break; } @@ -88,30 +82,14 @@ } @reset($querys); - @reset($files); - @reset($filedel); $query = "delete from $HOST_SERVICES_TABLE where HostID=$hostid"; $q1 = mysql_db_query($DBASE,$query) or die ("\"$query\" is a bad query."); - if ($filedel) { - while (list(,$file)=each($filedel)) { - unlink($file); - } - } - if ($querys) { while (list(,$query)=each($querys)) { echo "<!-- $query -->\n"; $q1 = mysql_db_query($DBASE,$query) or die ("\"$query\" is a bad query."); - } - } - - if ($files) { - while (list($filename,$text)=each($files)) { - $fp = fopen($filename,"w") or die ("Can't open $filename."); - fputs($fp,$text); - fclose($fp); } }

« previous php.mirrors (#9729) next »