當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sotf_Utils::clean方法代碼示例

本文整理匯總了PHP中sotf_Utils::clean方法的典型用法代碼示例。如果您正苦於以下問題:PHP sotf_Utils::clean方法的具體用法?PHP sotf_Utils::clean怎麽用?PHP sotf_Utils::clean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sotf_Utils的用法示例。


在下文中一共展示了sotf_Utils::clean方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isNameInUse

 /** static */
 function isNameInUse($stationName)
 {
     global $db;
     $res = $db->getOne("SELECT count(*) FROM sotf_stations WHERE name='" . sotf_Utils::clean($stationName) . "'");
     if (DB::isError($res)) {
         raiseError($res);
     }
     return $res;
 }
開發者ID:BackupTheBerlios,項目名稱:sotf-svn,代碼行數:10,代碼來源:sotf_Station.class.php

示例2: getSQLSafeParameter

 function getSQLSafeParameter($name)
 {
     return sotf_Utils::clean(sotf_Utils::getParameter($name), true);
 }
開發者ID:BackupTheBerlios,項目名稱:sotf-svn,代碼行數:4,代碼來源:sotf_Utils.class.php

示例3: delUserFromStation

 /**
  * Removes the user from station.
  *
  * @param	string	$username	Userid
  * @param	string	$station	Station
  * @return	boolean	Returns true if succeeded
  * @todo	Error handling
  * @use	$db
  */
 function delUserFromStation($username, $station)
 {
     global $db;
     $username = sotf_Utils::clean($username);
     $station = sotf_Utils::clean($station);
     $db->query("DELETE FROM sotf_user_group WHERE username='{$username}' AND station='{$station}'");
     return true;
 }
開發者ID:BackupTheBerlios,項目名稱:sotf-svn,代碼行數:17,代碼來源:sotf_Permission.class.php

示例4: simpleSearch

 function simpleSearch($text, $language, $from, $count)
 {
     $db = $this->db;
     $sql = "SELECT * FROM sotf_programmes WHERE published='t' ";
     $sql .= " AND (title ~* '{$text}' OR keywords ~* '{$text}' OR abstract ~* '{$text}' OR author ~* '{$text}' OR spatial_coverage ~* '{$text}') ";
     if ($language && $language != 'any_language') {
         $language = sotf_Utils::clean($language);
         $sql .= " AND language='{$language}' ";
     }
     $sql .= " ORDER BY production_date DESC ";
     $res = $db->limitQuery($sql, $from, $count);
     if (DB::isError($res)) {
         raiseError($res->getMessage());
     }
     while (DB_OK === $res->fetchInto($row)) {
         debug("row", $row['title']);
         $list[] = new sotf_Programme($row['id'], $row);
     }
     return $list;
 }
開發者ID:BackupTheBerlios,項目名稱:sotf-svn,代碼行數:20,代碼來源:sotf_Repository.class.php

示例5: login

 function login($name, $password)
 {
     global $user, $userdb, $page;
     $pwd = $userdb->getOne("SELECT passwd FROM authenticate WHERE username='" . sotf_Utils::clean($name) . "'");
     if (DB::isError($pwd)) {
         raiseError("could not compare passwords");
     }
     if ($pwd != $password) {
         error_log("Login failed for {$name} from " . getHostName(), 0);
         return $page->getlocalized("invalid_login");
     } else {
         $user = new sotf_User($name);
         $userdb->query("UPDATE user_preferences SET num_logins=num_logins+1, last_visit='" . db_Wrap::getSQLDate() . "' WHERE auth_id='" . $user->id . "' ");
         $_SESSION['username'] = $user->name;
     }
 }
開發者ID:BackupTheBerlios,項目名稱:sotf-svn,代碼行數:16,代碼來源:sotf_User.class.php


注:本文中的sotf_Utils::clean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。