當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Sanitize::safeword方法代碼示例

本文整理匯總了PHP中Sanitize::safeword方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sanitize::safeword方法的具體用法?PHP Sanitize::safeword怎麽用?PHP Sanitize::safeword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sanitize的用法示例。


在下文中一共展示了Sanitize::safeword方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: time

                }
            }
        }
    }
    // If there are no defaults
    if (!isset($_POST['run_cycle'])) {
        $_POST['run_cycle'] = 3600;
    }
    if (!isset($_POST['date_start'])) {
        $_POST['date_start'] = time();
    }
    if (!isset($_POST['date_end'])) {
        $_POST['date_end'] = 10;
    }
    // Sanitize Values
    $_POST['title'] = Sanitize::safeword($_POST['title']);
    $_POST['method'] = Sanitize::variable($_POST['method']);
    $_POST['run_cycle'] = Sanitize::number($_POST['run_cycle'], 0);
    $_POST['date_start'] = Sanitize::number($_POST['date_start'], 0);
    $_POST['date_end'] = Sanitize::number($_POST['date_end'], 0);
    // Sanitize Parameters
    for ($a = 0; $a <= 3; $a++) {
        $_POST['args'][$a] = isset($_POST['args'][$a]) ? Sanitize::text($_POST['args'][$a]) : "";
    }
}
// Run Header
require SYS_PATH . "/controller/includes/admin_header.php";
// Get Navigation Entry
echo '
<h2 style="margin-top:20px;">' . ($editID ? 'Edit' : 'Create New') . ' Cron Task</h2>
開發者ID:SkysteedDevelopment,項目名稱:Deity,代碼行數:30,代碼來源:custom-task.php

示例2: isset

                // Reset Values
                $_POST['handle'] = "";
                $_POST['display_name'] = "";
                $_POST['email'] = "";
                $_POST['password'] = "";
            }
        } else {
            Database::endTransaction(false);
            Alert::error("Process Error", "An error has occurred while processing this registration.", 1);
        }
    }
} else {
    $_POST['email'] = isset($_POST['email']) ? Sanitize::email($_POST['email']) : "";
    $_POST['password'] = isset($_POST['password']) ? Sanitize::safeword($_POST['password']) : "";
    $_POST['handle'] = isset($_POST['handle']) ? Sanitize::variable($_POST['handle']) : "";
    $_POST['display_name'] = isset($_POST['display_name']) ? Sanitize::safeword($_POST['display_name'], ' ') : "";
}
// Run Header
require SYS_PATH . "/controller/includes/admin_header.php";
// Display the Editing Form
echo '
<h3>Add a New User</h3>
<form class="uniform" action="/admin/AppAccount/Add User" method="post">' . Form::prepare("add-user-uni6") . '

<p>
	<strong>Profile Handle:</strong><br />
	<input type="text" name="handle" value="' . $_POST['handle'] . '" style="width:200px;" maxlength="22" />
</p>

<p>
	<strong>Profile Display Name:</strong><br />
開發者ID:SkysteedDevelopment,項目名稱:Deity,代碼行數:31,代碼來源:Add+User.php


注:本文中的Sanitize::safeword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。