当前位置: 首页>>代码示例>>PHP>>正文


PHP Sanitize::cleanString方法代码示例

本文整理汇总了PHP中Sanitize::cleanString方法的典型用法代码示例。如果您正苦于以下问题:PHP Sanitize::cleanString方法的具体用法?PHP Sanitize::cleanString怎么用?PHP Sanitize::cleanString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sanitize的用法示例。


在下文中一共展示了Sanitize::cleanString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Sanitize

<?php

require_once '../LoginApi/auth.php';
include "dbconnect.php";
include "variable.php";
require_once "includes/ContentSanitize.class.php";
$san = new Sanitize();
$event_id = 42;
$user_name = trim($_POST['user']);
$password = trim($_POST['pass']);
$user_name = strip_tags($user_name);
$user_name = htmlentities($user_name, ENT_QUOTES);
$user_name = $san->cleanString($user_name);
$password = strip_tags($password);
$password = htmlentities($password, ENT_QUOTES);
$password = $san->cleanString($password);
if (validate($user_name, $password, $event_id)) {
    session_start();
    $_SESSION['user_platzen'] = $user_name;
    $_SESSION['islogin'] = 1;
    $_SESSION['isregistered_platzen'] = 1;
    $check = 1;
}
//	echo validate($user_name, $password, $event_id);
if ($check == 1) {
    //Correct User
    //echo $user_name;
    $query = "SELECT * from user_info_pla where user_id='{$user_name}'";
    $result = mysql_query($query) or die("Could not retrieve database");
    if (mysql_num_rows($result) == 0) {
        $user_insert = mysql_query("INSERT user_info_pla (user_id) VALUES ('{$user_name}') ");
开发者ID:shubhamsharma24,项目名称:Website-EffervescenceMMXIV,代码行数:31,代码来源:event_login.php

示例2: die

$x = mysql_fetch_array($result);
$qid = $x['score'] + 1;
echo $qid;
$query = "SELECT ans FROM question_info_ste where qid='{$qid}'";
$result = mysql_query($query) or die("Query failed:1 " . mysql_error());
$row = mysql_fetch_array($result);
$ans = $row['ans'];
$san = new Sanitize();
//echo $pro_ans." ".$ans;
$pro_ans = $_POST['pro_ans'];
$pro_ans = strip_tags($pro_ans);
$pro_ans = trim($pro_ans);
$pro_ans = htmlentities($pro_ans, ENT_QUOTES);
$pro_ans = strtolower($pro_ans);
$pro_ans = addslashes($pro_ans);
$pro_ans = $san->cleanString($pro_ans);
$pro_ans = md5($pro_ans);
$ans = htmlentities(stripslashes($ans), ENT_QUOTES);
//Security////
if ($pro_ans == $ans) {
    //updating the time of submission
    //$mani = date('H:i:s',time() + (4 * 60));
    $mani = date('Y-m-d H:i:s', time());
    $query = "UPDATE user_info_ste SET  score=score+1, time = '{$mani}' WHERE user_id ='{$_SESSION['user_stegolica']}'";
    $result = mysql_query($query) or die("Query failed2: " . mysql_error());
    //$_SESSION['score']=$_SESSION['score']+1;
    $_SESSION['message'] = "";
    if ($qid == $total_question) {
        header("Location: winner.php");
    }
} else {
开发者ID:shubhamsharma24,项目名称:Website-EffervescenceMMXIV,代码行数:31,代码来源:question_process.php


注:本文中的Sanitize::cleanString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。