本文整理汇总了PHP中input_check函数的典型用法代码示例。如果您正苦于以下问题:PHP input_check函数的具体用法?PHP input_check怎么用?PHP input_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了input_check函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
// Extra headers for TD..
$extra_headers = "<STYLE TYPE=\"text/css\" > " . " TH.red { background-color: red } " . " TH.orange { background-color: orange } " . " TH.white { background-color: white; color: black} " . "</STYLE>";
print_header($extra_headers);
print_title("Alliances", "An alliance is a coorperation between 2 or more users. Create your own alliance and increase it's size by let other users join in on your alliance.");
$cmd = input_check("create", 0, "show", "aid", 0, "partjoin", "!frmid", "aid", "uid", 0, "requestjoin", "!frmid", "rid", 0);
if ($cmd == "create") {
create_alliance();
}
if ($cmd == "show") {
show_alliance(user_ourself(), $aid);
}
if ($cmd == "partjoin") {
partjoin_alliance($aid, $uid);
show_alliance(user_ourself(), $aid);
}
if ($cmd == "requestjoin") {
request_join_alliance($rid);
}
create_submenu(array("Show Alliances" => "alliance.php?cmd=" . encrypt_get_vars("show"), "Create New Alliance" => "alliance.php?cmd=" . encrypt_get_vars("create")));
print_footer();
exit;
// ============================================================================
// Show_Alliance()
//
// Description:
示例2: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
// Extra headers for TD..
$extra_headers = "<STYLE TYPE=\"text/css\" > " . " TH.red { background-color: red } " . " TH.orange { background-color: orange } " . " TH.white { background-color: white; color: black} " . "</STYLE>";
print_header($extra_headers);
print_title("User information");
$cmd = input_check("show", "uid", 0, "showdetail", "uid", 0, "relation", "!frmid", "!uid", "!wid", 0);
if ($cmd == "show") {
if ($uid == "") {
$uid = user_ourself();
}
show_users($uid);
}
if ($cmd == "showdetail") {
if ($uid == "") {
$uid = user_ourself();
}
user_showinfo($uid, USER_SHOWINFO_NORMAL);
}
if ($cmd == "relation") {
set_relation(user_ourself(), $uid, $wid);
show_users(user_ourself());
}
print_footer();
exit;
// ============================================================================================
//
示例3: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Move vessel", "Move your vessels around the place in this screen. Select a vessel you want to move. Vessels that are part of traderoutes or of convoys are not shown.");
$cmd = input_check("showuid", "uid", 0, "showvid", "!vid", 0, "goauto", "!vid", "!did", 0, "gopreset", "!vid", "!pid", 0, "gomanual", "!vid", "!ne_distance", "!ne_angle", 0);
// Shows all ships from user $uid or ourself
if ($cmd == "showuid") {
if ($uid == "") {
$uid = user_ourself();
}
vessel_select_vessel_by_user($uid, $_SERVER['PHP_SELF'], "Select one of your vessels to move:", NO_SHOW_TRADEROUTES);
}
// Shows vessel $vid and let the user select a destination
if ($cmd == "showvid") {
select_destination($vid);
}
// Sets vessel $vid off to destination id $did (either 0 means hold, S001 means sector ID 1, or 001 means planet id 1)
if ($cmd == "goauto") {
if ($did == "0") {
$ok = "Vessel stopped at current location..\n";
} else {
$ok = "Vessel flight in process..\n";
}
$errors['PARAMS'] = "Incorrect parameters specified..\n";
$errors['NOEXPLORE'] = "You must use a exploration vessel when flying to an unknown planet...\n";
$data['vid'] = $vid;
$data['did'] = $did;
示例4: ReflectionMethod
// args binding
// strongly inspired by luofei ( http://weibo.com/luofei614 )
$method = new ReflectionMethod($o, $a);
$params = $method->getParameters();
$args = array();
foreach ($params as $param) {
$name = $param->getName();
if ($param->isDefaultValueAvailable()) {
// get default value
$dval = $param->getDefaultValue();
$reg = '/\\:(.+?)\\|(.*)$/is';
// is filter
if (preg_match($reg, $dval, $out)) {
$fliter_func = t($out[1]);
$info = t($out[2]);
$ret = input_check(v($name), $fliter_func, $info);
$args[$name] = $ret;
} else {
// not filter so set as default value
if (isset($_REQUEST[$name])) {
$args[$name] = v($name);
if (is_string($args[$name])) {
$args[$name] = t($args[$name]);
}
} else {
$args[$name] = $dval;
}
}
}
}
$method->invokeArgs($o, $args);
示例5: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Science office", "In the science office you can decide on what area your scientist will focus on. It will also give you the opportunity to increase or decrease your tax ratio. The higher this ratio the more credits you will receive each tick. The downside however is that people will get less happy and your scientists will invent at a slower level.");
$cmd = input_check("show", "uid", 0, "setrate", "!frmid", "uid", "ne_building_rate", "ne_vessel_rate", "ne_invention_rate", "ne_explore_rate", "ne_science_ratio", 0);
if ($cmd == "setrate") {
if ($uid == "") {
$uid = user_ourself();
}
$user = user_get_user($uid);
if ($ne_science_ratio == "") {
$ne_science_ratio = $user['science_ratio'];
}
if ($ne_building_rate == "") {
$ne_building_rate = $user['science_building'];
}
if ($ne_vessel_rate == "") {
$ne_vessel_rate = $user['science_vessel'];
}
if ($ne_invention_rate == "") {
$ne_invention_rate = $user['science_invention'];
}
if ($ne_explore_rate == "") {
$ne_explore_rate = $user['science_explore'];
}
if ($ne_building_rate + $ne_vessel_rate + $ne_invention_rate + $ne_explore_rate != 100) {
print_line("<font color=red><center><strong>Warning:</strong><br>Your percentage settings must be equal to 100%!<br>New rating is not set!</center></font>");
示例6: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Sector view", "Here you will find all discovered sectors and planets on one single page. It will also let you claim sectors if appropriate.");
$cmd = input_check("show", "sid", "uid", 0, "claim", "!frmid", "!sid", "!ne_name", 0);
if ($uid == "") {
$uid = user_ourself();
}
if ($cmd == "show") {
if ($sid == "") {
sector_show_all_sectors($uid);
} else {
sector_show_sector($sid, $uid);
}
}
if ($cmd == "claim") {
$ok = "";
$errors['PARAMS'] = "Incorrect parameters specified..\n";
$errors['NAME'] = "The sector name already exists.\n";
$data['sector_id'] = $sid;
$data['name'] = convert_crlf_to_px_tag($ne_name);
comm_send_to_server("SECTOR", $data, $ok, $errors);
}
print_footer();
exit;
// ============================================================================================
//
示例7: get_value_post
}
// Disconnect
$mysqli->close();
}
// read in form values
$name = get_value_post("name");
$email = get_value_post("email");
$year = get_value_post("year");
$month = get_value_post("month");
$day = get_value_post("day");
$sex = get_value_post("sex");
$terms = get_value_post("terms");
// check if the form has been submitted -- any of the input values is set
$submitted = isset($_POST['name']);
if ($submitted) {
// check for errors
$errors = input_check($name, $email, $year, $month, $day, $sex, $terms);
if (count($errors) > 0) {
display_form($name, $email, $year, $month, $day, $sex, $terms, $errors);
} else {
confirm($name, $email, $year, $month, $day, $sex);
save_to_mysql($name, $email, $year, $month, $day, $sex);
}
} else {
// display form for the first time
display_form();
}
?>
</body>
</html>
示例8: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Planet stuff");
$cmd = input_check("show", "sid", "uid", 0);
if ($cmd == "show") {
if ($sid == "") {
if ($uid == "") {
$uid = user_ourself();
}
conview_show_all_sectors($uid);
} else {
conview_show_sector($sid);
}
}
print_footer();
exit;
// ============================================================================================
//
//
// Description:
//
//
// Parameters:
//
//
// Returns:
示例9: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Scoring board");
$cmd = input_check("show", "!tbl", "ofs", "uid", 0);
if ($cmd == "show") {
if ($uid == "") {
$uid = user_ourself();
}
show_score($tbl, $ofs, $uid);
score_showuser($uid);
}
print_footer();
exit;
// ============================================================================================
//
//
// Description:
//
//
// Parameters:
//
//
// Returns:
//
//
function show_score($table, $offset, $user_id)
示例10: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Buildings & Inventions", "All buildings, vessels and inventions currently known in the game are shown on this page. Only the details of the items you already discovered are available.");
$cmd = input_check("show", "uid", 0, "showvid", "vid", 0, "showbid", "bid", 0, "showiid", "iid", 0);
if ($cmd == "show") {
if ($uid == "") {
$uid = user_ourself();
}
print_disoveries($uid);
}
if ($cmd == "showbid") {
building_show_details($bid, 0, 0, "");
}
if ($cmd == "showvid") {
vessel_show_type_details($vid, 0, 0, "");
}
if ($cmd == "showiid") {
invention_show_details($iid, 0, 0, "");
}
print_footer();
exit;
// ============================================================================================
//
//
// Description:
//
示例11: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Message Office", "In the office you can read and send message from your empirium, your alliance and even intercept galaxy messages. The higher your exploration level is, the more messages you can intercept from inside the galaxy. Always beware that messages from and to other people can be intercepted so beware on what you write.");
$cmd = input_check("post", "!frmid", "target", "src_uid", "ne_msg", "ne_subject", "ne_priority", "ne_level", "aid", "dst_uid", 0, "delete", "!frmid", "!mid", "!bid", "uid", 0, "creategalaxy", "gid", 0, "createuser", "!frmid", "uid", 0, "createalliance", "aid", 0, "show", "msgbox", "uid", 0);
if ($cmd == "delete") {
$data['mid'] = $mid;
comm_send_to_server("MESSAGEDEL", $data, "", "");
if ($uid == "") {
$uid = user_ourself();
}
message_show_all($uid, $bid);
}
if ($cmd == "post") {
$ok = "Message send succesfully.";
$errors['PARAMS'] = "No decent params given.";
$errors['SUBJECT'] = "Please enter a subject.";
$errors['LEVEL'] = "Please enter a minimum level between 0 and 99999";
$errors['MSG'] = "Cannot send an empty message.";
$data['target'] = $target;
$data['src_uid'] = $src_uid;
$data['dst_uid'] = $dst_uid;
$data['prio'] = $ne_priority;
$data['level'] = $ne_level;
$data['msg'] = convert_crlf_to_px_tags($ne_msg);
$data['subject'] = $ne_subject;
comm_send_to_server("MESSAGECREATE", $data, $ok, $errors);
示例12: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Anomaly view");
$cmd = input_check("show", "aid", "uid", 0, "claim", "!frmid", "!aid", "uid", "!ne_name", 0, "description", "!aid", 0, "description2", "!frmid", "!aid", "!ne_description", 0);
// Change description (post to server)
if ($cmd == "description") {
edit_description($aid);
}
if ($cmd == "description2") {
$ok = "";
$errors['PARAMS'] = "Incorrect parameters specified..\n";
$data['anomaly_id'] = $aid;
$data['description'] = convert_crlf_to_px_tags($ne_description);
comm_send_to_server("ANOMALYDESC", $data, $ok, $errors);
show_anomaly($aid);
}
if ($cmd == "show") {
if ($uid == "") {
$uid = user_ourself();
}
if ($aid == "") {
show_all_user_anomalies($uid);
} else {
show_anomaly($aid);
}
}
示例13: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Trade routes");
$cmd = input_check("show", "uid", 0, "delete", "uid", 0, "create", "uid", 0, "delete2", "!frmid", "!tid", 0, "create2", "!frmid", "!vid", "!src_pid", "!dst_pid", 0);
if ($cmd == "show") {
if ($uid == "") {
$uid = user_ourself();
}
trade_show_routes($uid);
} elseif ($cmd == "create") {
if ($uid == "") {
$uid = user_ourself();
}
trade_create_route($uid);
} elseif ($cmd == "delete") {
if ($uid == "") {
$uid = user_ourself();
}
trade_delete_route($uid);
}
// Execute delete
if ($cmd == "delete2") {
$error = "";
$ok = "";
$data['aid'] = $tid;
comm_send_to_server("TRADEDELETE", $data, $error, $ok);
示例14: session_identification
<?php
// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
// Extra headers for TD..
$extra_headers = "<STYLE TYPE=\"text/css\" > " . " TD.t { color : white} " . " TD.f { color : red} " . "</STYLE>";
print_header($extra_headers);
print_title("Manufacturing");
$cmd = input_check("manufacture", "!frmid", "iid", "aid", 0, "show", "aid", 0);
if ($cmd == "show") {
// Show homeworld when nothing is set...
if ($aid == "") {
show_inventions(user_get_home_planet(user_ourself()));
} else {
show_inventions($aid);
}
}
if ($cmd == "manufacture") {
$ok = "";
$errors['PARAMS'] = "Incorrect parameters specified..\n";
$errors['CREDITS'] = "You don't have enough cash to construct the item...\n";
$errors['ORE'] = "You don't have enough ores to construct the item...\n";
$errors['MAX'] = "You cannot build anymore items of this type on the planet...\n";
$errors['DEPS'] = "You cannot build this item before you have build all dependencies...\n";
$data['anomaly_id'] = $aid;
$data['item_id'] = $iid;
if (comm_send_to_server("MANUFACTURE", $data, $ok, $errors) == 1) {
$invention = item_get_item($data['item_id']);
echo "<br><br><br><br>";
示例15: input_check
private function input_check($params)
{
$r = true;
$val = '';
$match = '![\\;\'\\"\\/\\%<>=#\\(\\)\\*]+!';
if (is_array($params)) {
foreach ($params as $k => $v) {
if (is_array($v)) {
input_check($v);
continue;
}
$val = $k . $v;
if (preg_match($match, $val)) {
$r = false;
}
}
} else {
if (preg_match($match, $val)) {
$r = false;
}
$val = $params;
}
if (strstr($val, 'union') || strstr($val, '0x') || strstr($val, 'load_file') || strstr($val, 'uotfile') || strstr($val, 'database') || strstr($val, 'benchmark') || strstr($val, 'script') || strstr($val, 'eval') || strstr($val, 'http') || strstr($val, 'ftp') || strstr($val, 'document') || strstr($val, 'hex')) {
$r = false;
}
if ($r === false) {
error('The are not allowed signs in the data.' . var_export($params));
}
return $r;
}