本文整理汇总了PHP中remove_junk函数的典型用法代码示例。如果您正苦于以下问题:PHP remove_junk函数的具体用法?PHP remove_junk怎么用?PHP remove_junk使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove_junk函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_msg
function display_msg($msg = '')
{
$output = array();
if (!empty($msg)) {
foreach ($msg as $key => $value) {
$output = "<div class=\"alert alert-{$key}\">";
$output .= "<a href=\"#\" class=\"close\" data-dismiss=\"alert\">×</a>";
$output .= remove_junk(first_character($value));
$output .= "</div>";
}
return $output;
} else {
return "";
}
}
示例2: remove_junk
}
?>
</select>
</td>
<td>
<?php
if ($product['hasMAC'] > 0) {
echo "<input type='text' class='form-control' name='mac' maxlength='17' value='{$mac}' >";
} else {
echo "<input type='text' class='form-control' name='mac' maxlength='17' value='{$mac}' readonly>";
}
?>
</td>
<td>
<textarea name="comment" rows="1" style="width: 100%"><?php
echo remove_junk($sale['comment']);
?>
</textarea>
</td>
<td>
<button type="submit" name="update_sale" class="btn btn-primary">Oppdater Retur</button>
</td>
</form>
</tr>
</tbody>
</table>
</div>
</div>
</div>
示例3: array
<?php
include_once 'includes/load.php';
$req_fields = array('username', 'password');
validate_fields($req_fields);
$username = remove_junk($_POST['username']);
$password = remove_junk($_POST['password']);
if (empty($errors)) {
$user = authenticate_v2($username, $password);
if ($user) {
//create session with id
$session->login($user['id']);
//Update Sign in time
updateLastLogIn($user['id']);
// redirect user to group home page by user level
if ($user['user_level'] === '1') {
$session->msg("s", "Hello " . $user['username'] . ", Welcome to OSWA-INV.");
redirect('admin.php', false);
} elseif ($user['user_level'] === '2') {
$session->msg("s", "Hello " . $user['username'] . ", Welcome to OSWA-INV.");
redirect('special.php', false);
} else {
$session->msg("s", "Hello " . $user['username'] . ", Welcome to OSWA-INV.");
redirect('home.php', false);
}
} else {
$session->msg("d", "Sorry Username/Password incorrect.");
redirect('index.php', false);
}
} else {
$session->msg("d", $errors);
示例4: find_product_by_title
function find_product_by_title($product_name)
{
global $db;
$p_name = remove_junk($db->escape($product_name));
$sql = "SELECT name FROM products WHERE name like '%{$p_name}%' LIMIT 5";
$result = find_by_sql($sql);
return $result;
}
示例5: page_require_level
<?php
$page_title = 'Add User';
require_once 'includes/load.php';
// Checking userlevel
page_require_level(1);
$groups = find_all('user_groups');
if (isset($_POST['add_user'])) {
$req_fields = array('full-name', 'username', 'password', 'level');
validate_fields($req_fields);
if (empty($errors)) {
$name = remove_junk($db->escape($_POST['full-name']));
$username = remove_junk($db->escape($_POST['username']));
$password = remove_junk($db->escape($_POST['password']));
$user_level = (int) $db->escape($_POST['level']);
$password = sha1($password);
$query = "INSERT INTO users (";
$query .= "name,username,password,user_level,status";
$query .= ") VALUES (";
$query .= " '{$name}', '{$username}', '{$password}', '{$user_level}','1'";
$query .= ")";
if ($db->query($query)) {
//success
echo 'papp';
if (mysqli_connect_errno() == 1062) {
die('BANANA!');
}
$session->msg('s', "User account has been created! ");
// redirect('add_user.php', false);
} else {
//failed
示例6: remove_junk
<div class="panel-heading">
<strong>
<span class="glyphicon glyphicon-th"></span>
<span>Editing <?php
echo remove_junk(ucfirst($categorie['name']));
?>
</span>
</strong>
</div>
<div class="panel-body">
<form method="post" action="edit_categorie.php?id=<?php
echo (int) $categorie['id'];
?>
">
<div class="form-group">
<input type="text" class="form-control" name="categorie-name" value="<?php
echo remove_junk(ucfirst($categorie['name']));
?>
">
</div>
<button type="submit" name="edit_cat" class="btn btn-primary">Update categorie</button>
</form>
</div>
</div>
</div>
</div>
<?php
include_once 'layouts/footer.php';
示例7: date
<div class="header-date pull-left">
<strong><?php
echo date("F j, Y, g:i a");
?>
</strong>
</div>
<div class="pull-right clearfix">
<ul class="info-menu list-inline list-unstyled">
<li class="profile">
<a href="#" data-toggle="dropdown" class="toggle" aria-expanded="false">
<img src="uploads/users/<?php
echo $user['image'];
?>
" alt="user-image" class="img-circle img-inline">
<span><?php
echo remove_junk(ucfirst($user['name']));
?>
<i class="caret"></i></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="profile.php?id=<?php
echo (int) $user['id'];
?>
">
<i class="glyphicon glyphicon-user"></i>
Profile
</a>
</li>
<li>
<a href="edit_account.php" title="edit account">
示例8: count_id
?>
<tr>
<td class="text-center"><?php
echo count_id();
?>
</td>
<td><?php
echo remove_junk($sale['name']);
?>
</td>
<td class="text-center"><?php
echo (int) $sale['qty'];
?>
</td>
<td class="text-center"><?php
echo remove_junk($sale['total_saleing_price']);
?>
,-</td>
<td class="text-center"><?php
echo $sale['date'];
?>
</td>
<td class="text-center"><?php
echo first_character($sale['username']);
?>
</td>
</tr>
<?php
}
?>
</tbody>
示例9: page_require_level
// Checking userlevel
page_require_level(1);
if (isset($_POST['add'])) {
$req_fields = array('group-name', 'group-level');
validate_fields($req_fields);
if (find_by_groupName($_POST['group-name']) === false) {
$session->msg('d', '<b>Sorry!</b> Entered Group Name already in database!');
redirect('add_group.php', false);
} elseif (find_by_groupLevel($_POST['group-level']) === false) {
$session->msg('d', '<b>Sorry!</b> Entered Group Level already in database!');
redirect('add_group.php', false);
}
if (empty($errors)) {
$name = remove_junk($db->escape($_POST['group-name']));
$level = remove_junk($db->escape($_POST['group-level']));
$status = remove_junk($db->escape($_POST['status']));
$query = "INSERT INTO user_groups (";
$query .= "group_name,group_level,group_status";
$query .= ") VALUES (";
$query .= " '{$name}', '{$level}','{$status}'";
$query .= ")";
if ($db->query($query)) {
//sucess
$session->msg('s', "Group has been created! ");
redirect('add_group.php', false);
} else {
//failed
$session->msg('d', ' Sorry failed to create Group!');
redirect('add_group.php', false);
}
} else {
示例10: remove_junk
</h6>
</td>
<td class="text-right"><?php
echo remove_junk($result['buy_price']);
?>
</td>
<td class="text-right"><?php
echo remove_junk($result['sale_price']);
?>
</td>
<td class="text-right"><?php
echo remove_junk($result['total_sales']);
?>
</td>
<td class="text-right"><?php
echo remove_junk($result['total_saleing_price']);
?>
</td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr class="text-right">
<td colspan="4"></td>
<td colspan="1">Grand Total</td>
<td> $
<?php
echo number_format(add($results)[0], 2);
?>
示例11: echo
">
<?php
echo (int) $recent_sale['id'];
?>
</a>
</td>
<td><?php
echo remove_junk(ucfirst($recent_sale['name']));
?>
</td>
<td><?php
echo remove_junk(ucfirst($recent_sale['date']));
?>
</td>
<td>$<?php
echo remove_junk(ucfirst($recent_sale['price']));
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php
示例12: display_msg
?>
<div class="login-page">
<div class="text-center">
<h3>Edit Group</h3>
</div>
<?php
echo display_msg($msg);
?>
<form method="post" action="edit_group.php?id=<?php
echo (int) $e_group['id'];
?>
" class="clearfix">
<div class="form-group">
<label for="name" class="control-label">Group Name</label>
<input type="name" class="form-control" name="group-name" value="<?php
echo remove_junk(ucwords($e_group['group_name']));
?>
">
</div>
<div class="form-group">
<label for="level" class="control-label">Group Level</label>
<input type="number" class="form-control" name="group-level" value="<?php
echo (int) $e_group['group_level'];
?>
">
</div>
<div class="form-group">
<label for="status">Status</label>
<select class="form-control" name="status">
<option <?php
if ($e_group['group_status'] === '1') {
示例13: foreach
<tbody>
<?php
foreach ($all_groups as $a_group) {
?>
<tr>
<td class="text-center"><?php
echo count_id();
?>
</td>
<td><?php
echo remove_junk(ucwords($a_group['group_name']));
?>
</td>
<td class="text-center">
<?php
echo remove_junk(ucwords($a_group['group_level']));
?>
</td>
<td class="text-center">
<?php
if ($a_group['group_status'] === '1') {
?>
<span class="label label-success"><?php
echo "Aktiv";
?>
</span>
<?php
} else {
?>
<span class="label label-danger"><?php
echo "Inaktiv";
示例14: redirect
<?php
$results = '';
require_once 'includes/load.php';
if (!$session->isUserLoggedIn(true)) {
redirect('index.php', false);
}
if (isset($_POST['submit'])) {
$req_dates = array('start-date', 'end-date');
validate_fields($req_dates);
if (empty($errors)) {
$start_date = remove_junk(real_escape($_POST['start-date']));
$end_date = remove_junk(real_escape($_POST['end-date']));
$results = find_sale_by_dates($start_date, $end_date);
} else {
$session->msg("d", $errors);
redirect('sales_report.php', false);
}
}
include_once 'layouts/header.php';
?>
<div class="row">
<div class="col-md-6">
<?php
echo display_msg($msg);
?>
</div>
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
</div>
示例15: chunker
private function chunker(&$text, $style = "")
{
$errors = null;
$text = collapse_spaces($text);
$textarr = split_string($text);
$chunksarr = split_on_spaces($textarr, $this->spaces);
if ($style == "clean") {
$chunksarr = remove_junk($chunksarr);
}
$chunkhashes = null;
foreach ($chunksarr as $end => &$chunkarr) {
$chunkhashes[$end] = count_words($chunkarr);
}
if (!$chunkhashes) {
$errors[] = "Could not hash chunks. Huh.";
trigger_error("Could not hash chunks. Huh.");
return $errors;
}
// if cleaned style, remove all bad words and lc
$max = array_pop(array_keys($textarr)) + 1;
$maxlen = strlen("{$max}");
$pad = "%0{$maxlen}s";
foreach ($chunksarr as $end => $chunkarr) {
$endpad = $end + 1;
$endpad = sprintf($pad, $endpad);
$out = $this->write_txt($chunkarr, $endpad, $style);
$out2 = $this->write_csv($chunkhashes[$end], $endpad, $style);
if ($out || $out2) {
$errors = array_merge($out, $out2, $errors);
}
}
if ($errors) {
rrmdir($this->folder);
trigger_error("Something in the chunking process went wrong.");
}
return $errors;
}