• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP escape_data函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中escape_data函数的典型用法代码示例。如果您正苦于以下问题:PHP escape_data函数的具体用法?PHP escape_data怎么用?PHP escape_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: ping

 function ping($params)
 {
     global $dbc;
     if (!isset($_SESSION['server_id'])) {
         redirect('/');
     }
     $q = 'UPDATE servers SET last_used=NOW() WHERE id=' . (int) $_SESSION['server_id'] . ' AND session_id=\'' . escape_data(session_id()) . '\'';
     $r = mysqli_query($dbc, $q);
     if (mysqli_affected_rows($dbc) == 1) {
         return ajax_response('Success');
     } else {
         $_SESSION['server_id'] = -1;
         return ajax_response('Failure', TRUE);
     }
 }
开发者ID:Jach,项目名称:lucid_demo,代码行数:15,代码来源:HomeService.php


示例2: escape_data

 if (!empty($_POST['title'])) {
     $t = escape_data($_POST['title']);
 } else {
     $t = FALSE;
     echo "<p class=\"error\">Please enter a title.</p>";
 }
 // Check the number
 if (is_numeric($_POST['articlenumber'])) {
     $n = escape_data($_POST['articlenumber']);
 } else {
     $n = FALSE;
     echo "<p class=\"error\">Please number this article correctly. (e.g. 80)</p>";
 }
 // Clean the recommendation data
 if (!empty($_POST['recommendation'])) {
     $r = escape_data($_POST['recommendation']);
 }
 // Set the date
 $d = $_POST['year'] . '-' . $_POST['month'] . '-' . $_POST['day'];
 // Check if we've got everything
 if ($a && $t && $n) {
     // Let's go!
     // Handle the file upload
     $filename = "upload";
     if (isset($_FILES[$filename]) && $_FILES[$filename]['error'] != 4) {
         // Add the record to the database
         $query = "INSERT INTO uploads (file_name, file_size, file_type) VALUES ('{$_FILES[$filename]['name']}', '{$_FILES[$filename]['size']}', '{$_FILES[$filename]['type']}')";
         $result = mysqli_query($dbc, $query);
         if ($result) {
             // Return the upload id from the database
             $upload_id = mysqli_insert_id($dbc);
开发者ID:krsgrnt,项目名称:journaux,代码行数:31,代码来源:add_articles.php


示例3: array

require './includes/config.inc.php';
// The config file also starts the session.
// Require the database connection:
require MYSQL;
// Include the header file:
$page_title = 'Forgot Your Password?';
include './includes/header.html';
// For storing errors:
$pass_errors = array();
// If it's a POST request, handle the form submission:
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // Validate the email address:
    if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
        $email = $_POST['email'];
        // Check for the existence of that email address...
        $q = 'SELECT id FROM users WHERE email="' . escape_data($email, $dbc) . '"';
        $r = mysqli_query($dbc, $q);
        if (mysqli_num_rows($r) === 1) {
            // Retrieve the user ID:
            list($uid) = mysqli_fetch_array($r, MYSQLI_NUM);
        } else {
            // No database match made.
            $pass_errors['email'] = 'The submitted email address does not match those on file!';
        }
    } else {
        // No valid address submitted.
        $pass_errors['email'] = 'Please enter a valid email address!';
    }
    // End of $_POST['email'] IF.
    if (empty($pass_errors)) {
        // If everything's OK.
开发者ID:raynaldmo,项目名称:php-education,代码行数:31,代码来源:forgot_password.php


示例4: escape_data

<?php

//Connect to the database
require_once '../mysqli_connect.php';
require_once 'User.php';
require_once 'Cart.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    //Check Email
    if (preg_match('%^[A-Za-z0-9._\\%-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$%', stripslashes(trim($_POST['email'])))) {
        $email = escape_data($_POST['email']);
    } else {
        $email = FALSE;
        echo '<p><font color="red" size="+1">Please enter a valid email address!</font></p>';
    }
    if (preg_match('%^[A-za-z0-9]{4,20}$%', stripslashes(trim($_POST['password'])))) {
        $password = escape_data($_POST['password']);
    } else {
        $password = FALSE;
        echo '<p><font color="red" size="+1">Please enter a valid password!</font></p>';
    }
    // Load User
    $newUser = User::loadUser($dbc, $email, $password);
    //Load Cart
    $cart = $newUser->loadCart($dbc);
    //Save em to session
    session_start();
    $_SESSION["user"] = serialize($newUser);
    $_SESSION["cart"] = serialize($cart);
    header('Location: WelcomePage.php');
    mysqli_close($dbc);
}
开发者ID:Jordy281,项目名称:Web-Centric,代码行数:31,代码来源:login.php


示例5: stripslashes

    if (ini_get('magic_quotes_grc')) {
        $data = stripslashes($data);
    }
    if (!is_numeric($data)) {
        $data = mysql_real_escape_string($data);
    }
    return $data;
}
$id = $_GET['id'];
$cat_array = array('Appetizers', 'Salads', 'Sandwiches', 'Entrees', 'Sides', 'Desserts');
echo "<section id='edit-dish'><h2>Edit Dish</h2>";
if ($_GET['confirm'] == 'yes') {
    $name = escape_data($_POST['name']);
    $price = escape_data($_POST['price']);
    $desc = escape_data($_POST['desc']);
    $category = escape_data($_POST['category']);
    $sql = "UPDATE `scargo cafe menu` SET name='{$name}', `desc`='{$desc}', category='{$category}', price='{$price}' WHERE id='{$id}' LIMIT 1";
    $result = mysql_query($sql);
    if ($result) {
        ?>
	<div class="notification">
		<p>Item successfully updated</p>
	</div>
<?php 
    } else {
        ?>
	<div class="notification">
		<p>Unable to update item</p>
		<p>Error: <?php 
        echo mysql_error();
        ?>
开发者ID:keithand,项目名称:scargo,代码行数:31,代码来源:edit_dish.php


示例6: escape_data

 $message = NULL;
 // Create an empty new variable.
 // Check for an existing password.
 if (empty($_POST['password'])) {
     $p = FALSE;
     $message .= '<br>You forgot to enter your existing password!</br>';
 } else {
     $p = escape_data($_POST['password']);
 }
 // Check for a password and match against the confirmed password.
 if (empty($_POST['password1'])) {
     $np = FALSE;
     $message .= '<br>You forgot to enter your new password!</br>';
 } else {
     if ($_POST['password1'] == $_POST['password2']) {
         $np = escape_data($_POST['password1']);
     } else {
         $np = FALSE;
         $message .= '<br>Your new password did not match the confirmed new password!</br>';
     }
 }
 if ($p && $np) {
     // If everything's OK.
     $query = "SELECT username FROM users WHERE (username='{$username}' AND password=PASSWORD('{$p}') )";
     $result = @mysql_query($query);
     $num = mysql_num_rows($result);
     if ($num == 1) {
         $row = mysql_fetch_array($result, MYSQL_NUM);
         // Make the query.
         $query = "UPDATE users SET password=PASSWORD('{$np}') WHERE username='{$row['0']}'";
         $result = @mysql_query($query);
开发者ID:jasimmk,项目名称:DeveloperSupport,代码行数:31,代码来源:changepass.php


示例7: escape_data

 if (!empty($_POST['firstname'])) {
     $f = escape_data($_POST['firstname']);
 } else {
     $f = FALSE;
     echo '<p><font color="red">Please enter a first name.</font></p>';
 }
 // Check the second name
 if (!empty($_POST['lastname'])) {
     $l = escape_data($_POST['lastname']);
 } else {
     $l = FALSE;
     echo '<p><font color="red">Please enter a last name.</font></p>';
 }
 // Check the email address
 if (!empty($_POST['email'])) {
     $e = escape_data($_POST['email']);
     // Check there is an @ sign and at least one dot
     if (strpos($e, "@") === FALSE || strpos($e, ".") === FALSE || strpos($e, " ") != FALSE || strpos($e, "@") > strrpos($e, ".")) {
         $e = FALSE;
         echo "<p class=\"error\">Email address was invalid and disregarded.</p>";
     }
 } else {
     $e = FALSE;
 }
 // Check if we've got everything
 if ($f && $l) {
     // Let's go!
     // Add to the authors table
     $query = "INSERT INTO authors (firstname, lastname, email) VALUES ('{$f}', '{$l}', '{$e}')";
     // Create the query
     $result = mysqli_query($dbc, $query);
开发者ID:krsgrnt,项目名称:journaux,代码行数:31,代码来源:authors.php


示例8: escape_data

 }
 // Check for a last name:
 if (preg_match('/^[A-Z \'.-]{2,45}$/i', $_POST['last_name'])) {
     $ln = escape_data($_POST['last_name'], $dbc);
 } else {
     $reg_errors['last_name'] = 'Please enter your last name!';
 }
 // Check for a username:
 if (preg_match('/^[A-Z0-9]{2,45}$/i', $_POST['username'])) {
     $u = escape_data($_POST['username'], $dbc);
 } else {
     $reg_errors['username'] = 'Please enter a desired name using only letters and numbers!';
 }
 // Check for an email address:
 if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === $_POST['email']) {
     $e = escape_data($_POST['email'], $dbc);
 } else {
     $reg_errors['email'] = 'Please enter a valid email address!';
 }
 // Check for a password and match against the confirmed password:
 if (preg_match('/^(\\w*(?=\\w*\\d)(?=\\w*[a-z])(?=\\w*[A-Z])\\w*){6,}$/', $_POST['pass1'])) {
     if ($_POST['pass1'] === $_POST['pass2']) {
         $p = $_POST['pass1'];
     } else {
         $reg_errors['pass2'] = 'Your password did not match the confirmed password!';
     }
 } else {
     $reg_errors['pass1'] = 'Please enter a valid password!';
 }
 if (empty($reg_errors)) {
     // If everything's OK...
开发者ID:raynaldmo,项目名称:php-education,代码行数:31,代码来源:register.php


示例9: escape_data

        if (getFleetStat($str, $sid, $d) != 0) {
            $go = false;
            break;
        }
    }
    if ($go) {
        $query = "DELETE FROM fleet{$sid} WHERE id={$d}";
        $result = @mysql_query($query);
        echo 'Your fleet has been deleted.<br><br>';
    } else {
        echo 'The fleet must be empty to delete it.<br><br>';
    }
}
//reset the probes
if (isset($_GET[p])) {
    $p = (int) escape_data($_GET[p]);
    //Check if you own the fleet
    if (getFleetStat(ownerid, $sid, $p) != $id) {
        echo 'err';
        exit;
    }
    setFleetStat(probes, 0, $sid, $p);
    setFleetStat(probetime, 0, $sid, $p);
    setFleetStat(report, " ", $id, $p);
}
/***********
JAVASCRIPT AND MENU
**********/
echo '
<script language="Javascript">
var change = function(x){
开发者ID:sp1ke77,项目名称:playconquest,代码行数:31,代码来源:fleet.php


示例10: escape_data

<?php

/**/
include './header.php';
if (isset($_GET['id'])) {
    $oid = (int) escape_data($_GET['id']);
    if (isset($_GET['type'])) {
        $type = (int) escape_data($_GET['type']);
        if ($type != 1 && $type != 2) {
            $type = 1;
        }
    } else {
        $type = 1;
    }
} else {
    echo 'err';
    exit;
}
/***********
TYPES
1 = Building
2 = Ship
***********/
echo '<table align="center" cellspacing=10>';
if ($type == 1) {
    echo '<tr>
			<td><b>Name</b></td>
			<td><b>Civs Cost</b></td>
			<td><b>Elinarium Cost</b></td>
			<td><b>Cylite Cost</b></td>
			<td><b>Plexi Cost</b></td>
开发者ID:sp1ke77,项目名称:playconquest,代码行数:31,代码来源:pedia.php


示例11: escape_data

<?php

require_once 'configmsgbrd.php';
$u = escape_data($_POST["user_id"]);
$tid = escape_data($_POST["topic_id"]);
$mt = escape_data($_POST["comment"]);
$pid = escape_data($_POST["parent_id"]);
$mb = escape_data($_POST["mess_block"]);
$token = escape_data($_POST["token_id"]);
$query1 = "SELECT user_id, tokenid FROM users WHERE (user_id='{$u}') AND (tokenid='{$token}')";
$result2 = mysql_query($query1) or trigger_error("An Error Occurred");
if (mysql_affected_rows() == 1) {
    $query2 = "INSERT INTO message (user_id, topic_id, message_txt, date, parent_id, mess_block) VALUES ('{$u}', '{$tid}', '{$mt}', NOW(), '{$pid}', '{$mb}')";
    $result2 = mysql_query($query2) or trigger_error("An Error Occurred");
    echo "Comment Has Been Submitted";
    exit;
    mysql_close();
} else {
    echo "Comment Has Been Declined";
    exit;
    mysql_close();
}
开发者ID:saeed81,项目名称:data_portal_project,代码行数:22,代码来源:sendInfoToServer.php


示例12: destroy_session

function destroy_session($sid)
{
    global $dbc;
    // Delete from the database.
    $q = sprintf('DELETE FROM sessions WHERE id="%s"', escape_data($sid));
    $r = mysqli_query($dbc, $q);
    // Clear the $_SESSION array:
    $_SESSION = array();
    return mysqli_affected_rows($dbc);
}
开发者ID:Jach,项目名称:lucid_demo,代码行数:10,代码来源:config.inc.php


示例13: escape_data

<?php

/**/
include './header.php';
//Check to see if you are already logged into a server
if (isset($sid)) {
    echo 'Error';
    exit;
}
//Check to see if the user is trying to join a server or enter a server
if (isset($_GET['s'])) {
    $sid = escape_data($_GET['s']);
    if (isOnServer($sid, $id)) {
        //Log into server
        $_SESSION['sid'] = $sid;
        changePage('./galaxy.php');
    } else {
        //Enter the server
        if (getServerStat(users, $sid) < getServerStat(maxusers, $sid)) {
            $users = getServerStat(users, $sid);
            $users++;
            $query = "UPDATE serverlist SET users={$users} WHERE id={$sid}";
            $result = @mysql_query($query);
            if ($result) {
                $bool = false;
                for ($x = 1; $x < 3; $x++) {
                    $string = "s" . $x;
                    $serverid = getUserStat($string, $id);
                    if ($serverid == 0) {
                        $query = "UPDATE users SET {$string}={$sid} WHERE id={$id}";
                        $result = @mysql_query($query);
开发者ID:sp1ke77,项目名称:playconquest,代码行数:31,代码来源:server.php


示例14: escape_data

		}
}

$action = $_GET['action'];
if($action == 'changepass'){
	include("functions/escape_data.php");
	$HostAccount = $_GET['HostAccount'];
	$cPW1 = $HTTP_POST_VARS[ "password1" ];
	$cPW2 = $HTTP_POST_VARS[ "password2" ];

	if(empty($_POST['password1'])) {
		$HostPassword = FALSE;
		$message2 .= '<br>You forgot to enter a password';
	} else {
	if($_POST['password1'] == $_POST['password2']) {
		$HostPassword = escape_data($_POST['password1']);
			if(strlen($HostPassword) < 6){
				   $message2 .= "<br>Your password $HostPassword  must be 6 characters";
				   $HostPassword = FALSE;
				} else {
					if (!preg_match("/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/", $HostPassword)) {
					  $message2 .= "<br>Your password does not meet complexity requirements";
					  $HostPassword = FALSE;
					}
				}
	} else {
		$HostPassword = FALSE;
		$message2 .= '<br>Your passwords do not match';
		}

	if($HostPassword){
开发者ID:jasimmk,项目名称:DeveloperSupport,代码行数:31,代码来源:hostdetails.php


示例15: escape_data

require '../dbconnect.php';
function escape_data($data)
{
    if (ini_get('magic_quotes_gpc')) {
        $data = stripslashes($data);
    }
    if (!is_numeric($data)) {
        $data = mysql_real_escape_string($data);
    }
    return $data;
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    //run all of the form data through the escape_data function
    $name = escape_data($_POST['name']);
    $review = escape_data($_POST['review']);
    $rating = escape_data($_POST['rating']);
    $cat_id = $_POST['cat_id'];
    $returnMsg = array();
    $returnMsg['submittedData'] = "<p>Name: {$name} rating: {$rating} email: {$email} review: {$review}</p>";
    //this code asses a new review to the reviews table
    $sql = "INSERT INTO reviews (id, name, review, rating, cat_id, date)\n\t\tVALUES ('', '{$name}', '{$review}', '{$rating}', '{$cat_id}', NOW() )";
    $result = mysql_query($sql);
    $returnmsg['insertReviewInfo'] = "<p>Info:" . mysql_info() . "</p>";
    $returnmsg['insertReviewError'] = "<p>Error:" . mysql_error() . "</p>";
    //set up SQL query to get all of the reviews for this product.
    $sql = "SELECT * FROM reviews WHERE cat_id = '{$cat_id}'";
    $result = mysql_query($sql);
    //Count and average all the ratings taken from all reviews of this product.
    $count = 0;
    $average_rating = 0;
    $total_rating = 0;
开发者ID:keithand,项目名称:strictlyunique,代码行数:31,代码来源:review.php


示例16: escape_data

    if (preg_match('%^[A-za-z0-9]{4,20}$%', stripslashes(trim($_POST['password'])))) {
        $test_password = escape_data($_POST['password']);
        if (preg_match('%^[A-za-z0-9]{4,20}$%', stripslashes(trim($_POST['confirmPassword'])))) {
            $confirmationPassword = escape_data($_POST['confirmPassword']);
            if (passwordChecker($test_password, $confirmationPassword)) {
                $user->password = escape_data($_POST['password']);
            }
        }
    }
    //Check Postal Code
    if (preg_match('%^[A-Za-z][0-9][A-Za-z]" "[0-9][A-Za-z][0-9]$%', stripslashes(trim($_POST['postalCode'])))) {
        $user->postalCode = escape_data($_POST['postalCode']);
    }
    //Check Dat of Birth
    if (preg_match('%^[0-9]{6}$%', stripslashes(trim($_POST['DOB'])))) {
        $user->DOB = escape_data($_POST['DOB']);
    }
    $user->gender = $_POST['Gender'];
    $query = "UPDATE users SET firstName=?, lastName=?, email=?, password=?, streetAddress=?, postalCode=?, DOB =?, gender=? WHERE id=?";
    $stmt = mysqli_prepare($dbc, $query);
    if (!$stmt) {
        die('mysqli error: ' . mysqli_error($dbc));
    }
    mysqli_stmt_bind_param($stmt, "ssssssdsd", $user->firstName, $user->lastName, $user->email, $user->streetAddress, $user->password, $user->postalCode, $user->DOB, $user->gender, $user->id);
    if (!mysqli_execute($stmt)) {
        die('stmt error: ' . mysqli_stmt_error($stmt));
    }
    $_SESSION['user'] = serialize($user);
    echo "<p>ACCOUNT UPDATED</p>";
}
?>
开发者ID:Jordy281,项目名称:Web-Centric,代码行数:31,代码来源:Profile.php


示例17: escape_data

include 'functions.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $meetsRequirements = TRUE;
    if (preg_match('%^[A-Za-z\\.\' \\-]{2,15}$%', stripslashes(trim($_POST['fn'])))) {
        $firstname = escape_data($_POST['fn']);
    } else {
        $meetsRequirements = FALSE;
    }
    if (preg_match('%^[A-Za-z\\.\' \\-]{2,15}$%', stripslashes(trim($_POST['ln'])))) {
        $lastname = escape_data($_POST['ln']);
    } else {
        $meetsRequirements = FALSE;
    }
    if (preg_match('%^[A-Za-z0-9._\\%-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$%', stripslashes(trim($_POST['email'])))) {
        $email = escape_data($_POST['email']);
    } else {
        $meetsRequirements = FALSE;
    }
    if (preg_match('%^([0-9]( |-)?)?(\\(?[0-9]{3}\\)?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$%', stripslashes(trim($_POST['work_phone'])))) {
        $phone = escape_data($_POST['work_phone']);
    } else {
        $meetsRequirements = FALSE;
    }
    if (!$meetsRequirements) {
        die;
    }
    $_SESSION["firstname"] = $firstname;
    $_SESSION["lastname"] = $lastname;
    $_SESSION["email"] = $email;
    $_SESSION["phone"] = $phone;
}
开发者ID:Jordy281,项目名称:Web-Centric,代码行数:31,代码来源:index.php


示例18: escape_data

 if (filter_var($_POST['category'], FILTER_VALIDATE_INT, array('min_range' => 1))) {
     $cat = $_POST['category'];
 } else {
     // No category selected.
     $add_page_errors['category'] = 'Please select a category!';
 }
 // Check for a description:
 if (!empty($_POST['description'])) {
     $d = escape_data(strip_tags($_POST['description']), $dbc);
 } else {
     $add_page_errors['description'] = 'Please enter the description!';
 }
 // Check for the content:
 if (!empty($_POST['content'])) {
     $allowed = '<div><p><span><br><a><img><h1><h2><h3><h4><ul><ol><li><blockquote>';
     $c = escape_data(strip_tags($_POST['content'], $allowed), $dbc);
 } else {
     $add_page_errors['content'] = 'Please enter the content!';
 }
 if (empty($add_page_errors)) {
     // If everything's OK.
     // Add the page to the database:
     $q = "INSERT INTO pages (categories_id, title, description, content) VALUES ({$cat}, '{$t}', '{$d}', '{$c}')";
     $r = mysqli_query($dbc, $q);
     if (mysqli_affected_rows($dbc) === 1) {
         // If it ran OK.
         // Print a message:
         echo '<div class="alert alert-success"><h3>The page has been added!</h3></div>';
         // Clear $_POST:
         $_POST = array();
         // Send an email to the administrator to let them know new content was added?
开发者ID:raynaldmo,项目名称:php-education,代码行数:31,代码来源:add_page.php


示例19: escape_data

     $country = escape_data($_POST['country']);
 }
 if (empty($_POST['countrycode'])) {
     $countrycode = FALSE;
     $message .= '<br>The country code field is required to continue</br>';
 } else {
     $countrycode = escape_data($_POST['countrycode']);
 }
 if (empty($_POST['phone'])) {
     $phone = FALSE;
     $message .= '<br>A valid phone number is required</br>';
 } else {
     $phone = escape_data($_POST['phone']);
 }
 if (isset($_POST['fax'])) {
     $fax = escape_data($_POST['fax']);
 }
 if ($reguName && $password && $lpquestion && $lpanswer && $fname && $lname & $email && $add1 && $city && $zip && $country && $countrycode && $phone) {
     $query = "SELECT username FROM users WHERE username='{$reguName}'";
     $result = @mysql_query($query);
     if (mysql_num_rows($result) == 0) {
         $query = "INSERT INTO users (username, password, lpquestion, lpanswer, fname, lname, email,  second_email, add1, add2, city, state, province, rspchoice, zip, country, countrycode, phone, fax, date, signup_date, isadmin)\n\t\tVALUES ('{$reguName}', PASSWORD('{$password}'), '{$lpquestion}', '{$lpanswer}', '{$fname}', '{$lname}', '{$email}', '{$second_email}', '{$add1}', '{$add2}', '{$city}', '{$state}', '{$province}', '{$rspchoice}', '{$zip}', '{$country}', '{$countrycode}', '{$phone}', '{$fax}', NOW(), NOW(), 1)";
         $result = @mysql_query($query);
         if ($result) {
             $StepNumber = 5;
             $_SESSION['StepNumber'] = 5;
             header("Location: install5.php");
             exit;
         } else {
             $message .= "There was an error writing the user to the database.<br>{$query}<br>";
         }
开发者ID:jasimmk,项目名称:DeveloperSupport,代码行数:31,代码来源:install4.php


示例20: array

    } else {
        $_SESSION['cycle'] = (int) $_REQUEST['period'];
    }
    echo '{ "success" : "true" }';
} else {
    // New bill add-on...
    $errors = array();
    $testDate = explode('-', $_POST["date"]);
    if (isset($testDate[0]) && isset($testDate[1]) && isset($testDate[2]) && checkdate($testDate[1], $testDate[2], $testDate[0])) {
        $date = $_POST["date"];
    } else {
        $errors[] = "The date you entered is not valid, please try again.";
        $date = NULL;
    }
    if (isset($_POST['descrip']) && !empty($_POST['descrip'])) {
        $description = escape_data($_POST['descrip']);
    } else {
        $description = NULL;
        $errors[] = "You left the description blank, please fill it in and try again.";
    }
    if (isset($_POST['amt']) && is_numeric($_POST['amt']) && $_POST['amt'] > 0) {
        $amount = (double) $_POST['amt'];
    } else {
        $amount = NULL;
        $errors[] = "The amount has to be a non-negative number.";
    }
    if (isset($_POST['payer']) && is_numeric($_POST['payer']) && $_POST['payer'] > 0) {
        $payer = (int) $_POST['payer'];
    } else {
        $payer = NULL;
        $errors[] = "Seriously, what are you doing?";
开发者ID:haus,项目名称:House-Bill-Management,代码行数:31,代码来源:viewHandler.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP escape_html函数代码示例发布时间:2022-05-15
下一篇:
PHP escape_check函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap