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


PHP MysqliDb::escape方法代码示例

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


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

示例1: header

 * @Last Modified by:   ananayarora
 * @Last Modified time: 2016-01-14 20:15:12
 */
session_start();
if (!isset($_SESSION['loggedin'])) {
    header("Location: signin.php?next=add.php");
}
if (isset($_POST['submit'])) {
    require 'conf.php';
    require 'sql.php';
    $c = new Conf();
    $o = new MysqliDb($c->host, $c->username, $c->password, $c->db);
    $insArr = array();
    foreach ($_POST as $key => $value) {
        if ($key == "valuation" || $key == "currentfunding") {
            $insArr[$key] = str_replace(",", "", $o->escape($value));
        } else {
            $insArr[$key] = $o->escape($value);
        }
    }
    $insArr['timeadded'] = time();
    $insArr['imageurl'] = 'data:image/png;base64,' . base64_encode(file_get_contents($_FILES['imageurl']['tmp_name']));
    unset($insArr['submit']);
    $o->insert("startups", $insArr);
    // header("Location: index.php");
}
require 'header.php';
?>
	<script src="http://clouddelivery.textbox.io/1/getEditor?apiKey=838eacr76gusx262p3cs4fwkjk104wsqun1nyelzulvy6okw"></script>
	<style type="text/css">
	textarea {
开发者ID:ananay,项目名称:seedup,代码行数:31,代码来源:add.php

示例2: header

/**
 * @Author: ananayarora
 * @Date:   2016-01-14 20:08:08
 * @Last Modified by:   ananayarora
 * @Last Modified time: 2016-01-14 23:41:31
 */
if (!isset($_GET['id'])) {
    header("Location: index.php");
}
require 'header.php';
require 'conf.php';
require 'sql.php';
$c = new Conf();
$o = new MysqliDb($c->host, $c->username, $c->password, $c->db);
$o->where("id", $o->escape($_GET['id']));
$k = $o->get("startups");
?>
<center>
	<div class="main_startup">
		<div style='background-image:url("<?php 
echo $k[0]['imageurl'];
?>
");' class="startup_photo"></div>
		<div class="startup_details">
			<h3 class="startup_name"><?php 
echo $k[0]['name'];
?>
</h3>
			<p class="oneliner"><?php 
echo $k[0]['oneliner'];
开发者ID:ananay,项目名称:seedup,代码行数:30,代码来源:view-startup.php

示例3: Conf

/**
 * @Author: ananayarora
 * @Date:   2016-01-14 22:34:55
 * @Last Modified by:   ananayarora
 * @Last Modified time: 2016-01-15 00:51:24
 */
require 'header.php';
if (isset($_POST['submit'])) {
    require 'conf.php';
    require 'sql.php';
    $c = new Conf();
    $o = new MysqliDb($c->host, $c->username, $c->password, $c->db);
    $insArr = array();
    foreach ($_POST as $key => $value) {
        $insArr[$key] = $o->escape($value);
    }
    unset($insArr['submit']);
    $o->insert("users", $insArr);
    header("Location: signin.php");
}
?>
	<center>
		<h2>Signup</h2>
	<form method="POST">
			<div class="mdl-textfield mdl-js-textfield">
				<input class="mdl-textfield__input" id="username" name="username" required/>
				<label class="mdl-textfield__label" for="username">Username</label>
			</div><br />
			<div class="mdl-textfield mdl-js-textfield">
				<input class="mdl-textfield__input" type="password" id="password" name="password" required/>
开发者ID:ananay,项目名称:seedup,代码行数:30,代码来源:signup.php


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