本文整理汇总了PHP中clear_string函数的典型用法代码示例。如果您正苦于以下问题:PHP clear_string函数的具体用法?PHP clear_string怎么用?PHP clear_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clear_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clear_string
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<table class="imagelist" border="1">
<tr>
<td>Изображение</td>
<td>Название</td>
<td>Заголовок</td>
<td>Название поста</td>
<td>Удалить из базы</td>
<td>Удалить полностью</td>
<td>Статус</td>
</tr>
<?php
$article_id = clear_string($_GET["article_id"]);
$query_img = mysql_query("SELECT * FROM uploads_images where item_id = '{$article_id}' order by image", $db);
if (mysql_num_rows($query_img) > 0) {
$result_img = mysql_fetch_array($query_img);
do {
$item_id = $result_img['item_id'];
if (strlen($result_img["image"]) > 0 && file_exists("../uploads_images/" . $result_img["image"])) {
$img_path = '../uploads_images/' . $result_img["image"];
$max_width = 100;
$max_height = 100;
list($width, $height) = getimagesize($img_path);
$ratioh = $max_height / $height;
$ratiow = $max_width / $width;
$ratio = min($ratioh, $ratiow);
//new demensions
$width = intval($ratio * $width);
$height = intval($ratio * $height);
} else {
$img_path = "./uploads_images/no-image-90.png";
示例2: clear_string
<?php
include 'include/connection.php';
include 'include/functions.php';
$id = clear_string($_GET["id"]);
$result = mysql_query("SELECT * FROM articles WHERE id='{$id}' AND visible='1'", $db);
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
$title = $row["title"];
$title1 = ftranslite($row["title"]);
$keywords = $row['meta_key'];
$description = $row['meta_desc'];
$id = $row['id'];
$img = $row['main_image'];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>WEIRD WORLD | <?php
echo $title;
?>
</title>
<?php
include 'include/assets.php';
?>
<meta property="og:type" content="article">
<meta property="og:title" content="<?php
示例3: clear_string
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
include "db_connect.php";
include "../functions/functions.php";
$email = clear_string($_POST["email"]);
if ($email != "") {
$result = mysql_query("SELECT email FROM reg_user WHERE email='{$email}'", $link);
if (mysql_num_rows($result) > 0) {
// Генерация пароля.
$newpass = fungenpass();
// Шифрование пароля.
$pass = md5($newpass);
$pass = strrev($pass);
$pass = strtolower("9nm2rv8q" . $pass . "2yo6z");
// Обновление пароля на новый.
$update = mysql_query("UPDATE reg_user SET pass='{$pass}' WHERE email='{$email}'", $link);
// Отправка нового пароля.
send_mail('noreply@shop.ru', $email, 'Новый пароль для сайта MyShop.ru', 'Ваш пароль: ' . $newpass);
echo 'yes';
} else {
echo 'Данный E-mail не найден!';
}
} else {
echo 'Укажите свой E-mail';
}
}
示例4: session_start
<?php
include "include/db_connect.php";
include "functions/functions.php";
session_start();
include "include/auth_cookie.php";
$cat = clear_string($_GET["cat"]);
$type = clear_string($_GET["type"]);
$sorting = $_GET["sort"];
switch ($sorting) {
case 'price-asc':
$sorting = 'price ASC';
$sort_name = 'От дешевых к дорогим';
break;
case 'price-desc':
$sorting = 'price DESC';
$sort_name = 'От дорогих к дешевым';
break;
case 'popular':
$sorting = 'count DESC';
$sort_name = 'Популярное';
break;
case 'news':
$sorting = 'datetime DESC';
$sort_name = 'Новинки';
break;
case 'brand':
$sorting = 'brand';
$sort_name = 'От дешевых к дорогим';
break;
default:
示例5: define
<?php
define('myeshop', true);
include "include/db_connect.php";
include "functions/functions.php";
session_start();
include "include/auth_cookie.php";
$go = clear_string($_GET["go"]);
switch ($go) {
case "news":
$query_aystopper = " WHERE visible = '1' AND new = '1'";
$name_aystopper = "New goods";
break;
case "leaders":
$query_aystopper = " WHERE visible = '1' AND leader = '1'";
$name_aystopper = "Best sels";
break;
case "sale":
$query_aystopper = " WHERE visible = '1' AND sale = '1'";
$name_aystopper = "Sale of goods";
break;
default:
$query_aystopper = "";
break;
}
$sorting = $_GET["sort"];
switch ($sorting) {
case 'price-asc':
$sorting = 'price ASC';
$sort_name = 'From cheap to expensive';
break;
示例6: define
if ($_SERVER["REQUEST_METHOD"] == "POST") {
define('myyshop', true);
session_start();
define('myeshop', true);
include "../include/db_connect.php";
include "../functions/functions.php";
$error = array();
$login = iconv("UTF-8", "cp1251", strtolower(clear_string($_POST['reg_login'])));
$pass = iconv("UTF-8", "cp1251", strtolower(clear_string($_POST['reg_pass'])));
$surname = iconv("UTF-8", "cp1251", clear_string($_POST['reg_surname']));
$name = iconv("UTF-8", "cp1251", clear_string($_POST['reg_name']));
$patronymic = iconv("UTF-8", "cp1251", clear_string($_POST['reg_patronymic']));
$email = iconv("UTF-8", "cp1251", clear_string($_POST['reg_email']));
$phone = iconv("UTF-8", "cp1251", clear_string($_POST['reg_phone']));
$address = iconv("UTF-8", "cp1251", clear_string($_POST['reg_address']));
if (strlen($login) < 5 or strlen($login) > 15) {
$error[] = "Логин должен быть от 5 до 15 символов!";
} else {
$result = mysql_query("SELECT login FROM reg_user WHERE login = '{$login}'", $link);
if (mysql_num_rows($result) > 0) {
$error[] = "Логин занят!";
}
}
if (strlen($pass) < 7 or strlen($pass) > 15) {
$error[] = "Укажите пароль от 7 до 15 символов!";
}
if (strlen($surname) < 3 or strlen($surname) > 20) {
$error[] = "Укажите Фамилию от 3 до 20 символов!";
}
if (strlen($name) < 3 or strlen($name) > 15) {
示例7: session_start
<?php
session_start();
define('myeshop', true);
include 'include/db_connect.php';
include 'include/functions.php';
if ($_POST["submit_enter"]) {
$login = clear_string($_POST["input_login"]);
$pass = clear_string($_POST["input_pass"]);
if ($login && $pass) {
/*
$pass = md5($pass);
$pass = strrev($pass);*/
$pass = md5($pass);
$pass = strrev($pass);
$pass = strtolower("8md7udyd" . $pass . "2ui6z");
$result = mysql_query("SELECT * FROM reg_admin WHERE login = '{$login}' AND pass = '{$pass}'", $link);
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
$_SESSION['auth_admin'] = 'yes_auth';
$_SESSION['auth_admin_login'] = $row["login"];
// Должность
$_SESSION['admin_role'] = $row["role"];
// Привилегии
// Заказы
$_SESSION['accept_orders'] = $row["accept_orders"];
$_SESSION['delete_orders'] = $row["delete_orders"];
$_SESSION['view_orders'] = $row["view_orders"];
// Товары
$_SESSION['delete_tovar'] = $row["delete_tovar"];
$_SESSION['add_tovar'] = $row["add_tovar"];
示例8: clear_string
}
$array = clear_string(CATEGORIES_IMAGE_THUMBNAIL_ELLIPSE);
if (CATEGORIES_IMAGE_THUMBNAIL_ELLIPSE !== '') {
$a->ellipse($array[0]);
}
$array = clear_string(CATEGORIES_IMAGE_THUMBNAIL_ROUND_EDGES);
if (CATEGORIES_IMAGE_THUMBNAIL_ROUND_EDGES != '') {
$a->round_edges($array[0], $array[1], $array[2]);
}
$string = str_replace("'", '', CATEGORIES_IMAGE_THUMBNAIL_MERGE);
$string = str_replace(')', '', $string);
$string = str_replace('(', DIR_FS_CATALOG_IMAGES, $string);
$array = explode(',', $string);
//$array=clear_string();
if (CATEGORIES_IMAGE_THUMBNAIL_MERGE != '') {
$a->merge($array[0], $array[1], $array[2], $array[3], $array[4]);
}
$array = clear_string(CATEGORIES_IMAGE_THUMBNAIL_FRAME);
if (CATEGORIES_IMAGE_THUMBNAIL_FRAME != '') {
$a->frame($array[0], $array[1], $array[2], $array[3]);
}
$array = clear_string(CATEGORIES_IMAGE_THUMBNAIL_DROP_SHADOW);
if (CATEGORIES_IMAGE_THUMBNAIL_DROP_SHADOW != '') {
$a->drop_shadow($array[0], $array[1], $array[2]);
}
$array = clear_string(CATEGORIES_IMAGE_THUMBNAIL_MOTION_BLUR);
if (CATEGORIES_IMAGE_THUMBNAIL_MOTION_BLUR != '') {
$a->motion_blur($array[0], $array[1]);
}
$a->create();
}
示例9: clear_string
$a->greyscale($array[0], $array[1], $array[2]);
}
$array = clear_string(CATEGORY_IMAGE_ELLIPSE);
if (CATEGORY_IMAGE_ELLIPSE != '') {
$a->ellipse($array[0]);
}
$array = clear_string(CATEGORY_IMAGE_ROUND_EDGES);
if (CATEGORY_IMAGE_ROUND_EDGES != '') {
$a->round_edges($array[0], $array[1], $array[2]);
}
$string = str_replace("'", '', CATEGORY_IMAGE_MERGE);
$string = str_replace(')', '', $string);
$string = str_replace('(', DIR_FS_CATALOG_IMAGES, $string);
$array = explode(',', $string);
//$array=clear_string();
if (CATEGORY_IMAGE_MERGE != '') {
$a->merge($array[0], $array[1], $array[2], $array[3], $array[4]);
}
$array = clear_string(CATEGORY_IMAGE_FRAME);
if (CATEGORY_IMAGE_FRAME != '') {
$a->frame($array[0], $array[1], $array[2], $array[3]);
}
$array = clear_string(CATEGORY_IMAGE_DROP_SHADOW);
if (CATEGORY_IMAGE_DROP_SHADOW != '') {
$a->drop_shadow($array[0], $array[1], $array[2]);
}
$array = clear_string(CATEGORY_IMAGE_MOTION_BLUR);
if (CATEGORY_IMAGE_MOTION_BLUR != '') {
$a->motion_blur($array[0], $array[1]);
}
$a->create();
示例10: define
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
define('myeshop', true);
include "db_connect.php";
include "../functions/functions.php";
$search = iconv("UTF-8", "cp1251", strtolower(clear_string($_POST['text'])));
$result = mysql_query("SELECT * FROM table_products WHERE title LIKE '%{$search}%' AND visible = '1'", $link);
if (mysql_num_rows($result) > 0) {
$result = mysql_query("SELECT * FROM table_products WHERE title LIKE '%{$search}%' AND visible = '1' LIMIT 10", $link);
$row = mysql_fetch_array($result);
do {
echo '
<li><a href="search.php?q=' . $row["title"] . '">' . $row["title"] . '</a></li>
';
} while ($row = mysql_fetch_array($result));
}
}
示例11: define
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
define('myeshop', true);
include "db_connect.php";
include "../functions/functions.php";
$search = strtolower(clear_string($_POST['text']));
$result = mysql_query("SELECT * FROM table_products WHERE title LIKE '%{$search}%' AND visible = '1'", $link);
if (mysql_num_rows($result) > 0) {
$result = mysql_query("SELECT * FROM table_products WHERE title LIKE '%{$search}%' AND visible = '1' LIMIT 10", $link);
$row = mysql_fetch_array($result);
do {
echo '<li><a href="search.php?q=' . $row["title"] . '">' . $row["title"] . '</a></li>';
} while ($row = mysql_fetch_array($result));
}
}
示例12: define
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
define('myeshop', true);
include 'db_connect.php';
include '../functions/functions.php';
$id = clear_string($_POST['id']);
$name = clear_string($_POST['name']);
$good = clear_string($_POST['good']);
$bad = clear_string($_POST['bad']);
$comment = clear_string($_POST['comment']);
mysql_query("INSERT INTO table_reviews(products_id,name,good_reviews,bad_reviews,comment,date)\n\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t'" . $id . "',\n\t\t\t\t\t\t\t'" . $name . "',\n\t\t\t\t\t\t\t'" . $good . "',\n\t\t\t\t\t\t\t'" . $bad . "',\n\t\t\t\t\t\t\t'" . $comment . "',\n\t\t\t\t\t\t\t\tNOW()\n\t\t\t\t\t\t)", $link);
echo 'yes';
}
示例13: clear_string
$a->greyscale($array[0], $array[1], $array[2]);
}
$array = clear_string(PRODUCT_IMAGE_THUMBNAIL_ELLIPSE);
if (PRODUCT_IMAGE_THUMBNAIL_ELLIPSE !== '') {
$a->ellipse($array[0]);
}
$array = clear_string(PRODUCT_IMAGE_THUMBNAIL_ROUND_EDGES);
if (PRODUCT_IMAGE_THUMBNAIL_ROUND_EDGES != '') {
$a->round_edges($array[0], $array[1], $array[2]);
}
$string = str_replace("'", '', PRODUCT_IMAGE_THUMBNAIL_MERGE);
$string = str_replace(')', '', $string);
$string = str_replace('(', DIR_FS_CATALOG_IMAGES, $string);
$array = explode(',', $string);
//$array=clear_string();
if (PRODUCT_IMAGE_THUMBNAIL_MERGE != '') {
$a->merge($array[0], $array[1], $array[2], $array[3], $array[4]);
}
$array = clear_string(PRODUCT_IMAGE_THUMBNAIL_FRAME);
if (PRODUCT_IMAGE_THUMBNAIL_FRAME != '') {
$a->frame($array[0], $array[1], $array[2], $array[3]);
}
$array = clear_string(PRODUCT_IMAGE_THUMBNAIL_DROP_SHADOW);
if (PRODUCT_IMAGE_THUMBNAIL_DROP_SHADOW != '') {
$a->drop_shadow($array[0], $array[1], $array[2]);
}
$array = clear_string(PRODUCT_IMAGE_THUMBNAIL_MOTION_BLUR);
if (PRODUCT_IMAGE_THUMBNAIL_MOTION_BLUR != '') {
$a->motion_blur($array[0], $array[1]);
}
$a->create();
示例14: clear_string
$cat = "WHERE type_tovara='mobile'";
break;
case 'notebook':
$cat_name = 'Ноутбуки';
$url = "cat=notebook&";
$cat = "WHERE type_tovara='notebook'";
break;
case 'notepad':
$cat_name = 'Планшеты';
$url = "cat=notepad&";
$cat = "WHERE type_tovara='notepad'";
break;
default:
$cat_name = $cat;
$url = "type=" . clear_string($type) . "&cat=" . clear_string($cat) . "&";
$cat = "WHERE type_tovara='" . clear_string($type) . "' AND brand='" . clear_string($cat) . "'";
break;
}
} else {
$cat_name = 'Все товары';
$url = "";
$cat = "";
}
$action = $_GET["action"];
if (isset($action)) {
$id = (int) $_GET["id"];
switch ($action) {
case 'delete':
if ($_SESSION['delete_tovar'] == '1') {
$delete = mysql_query("DELETE FROM table_products WHERE products_id = '{$id}'", $link);
} else {
示例15: clear_string
<?php
include "db_connect.php";
include "escaping.php";
$book_id = (int) clear_string($_GET['id']);
$result = mysql_query("SELECT * FROM books WHERE id = {$book_id} LIMIT 1", $link);
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
} else {
header("HTTP/1.1 404 Not Found");
include "error.php";
exit;
}
$genre = $row["genre"];
$genrem_result = mysql_query("SELECT name FROM genres WHERE id = '{$genre}'", $link);
$genrem_mark_row = mysql_fetch_array($genrem_result);
$genre_name = $genrem_mark_row["name"];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Скачать «<?php
echo $row["title"];
?>
» бесплатно и без регистрации в pdf</title>
<title>Дмитрий Глуховский: книга Метро 2035, скачать книгу в fb2, txt, epub, pdf или читать онлaйн, 978-5-17-090538-6</title><meta name="description" content="В электронной библиотеке ЛитРес можно скачать книгу «Метро 2035» в форматах fb2, txt, epub, pdf, а также скачать другие книги Дмитрия Глуховского! Отставляете и читайте отзывы о книге на ЛитРес!">
<link rel="shortcut icon" href="img/favicon.png" type="image/png">
<link rel="stylesheet" href="css/reset.css">