本文整理汇总了PHP中get_line函数的典型用法代码示例。如果您正苦于以下问题:PHP get_line函数的具体用法?PHP get_line怎么用?PHP get_line使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_line函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_user_info_by_id
function get_user_info_by_id($uid)
{
$sql_pre = "SELECT `username` ,`password` FROM `user` WHERE `id` = ?i AND username = ?s LIMIT 1 ";
$array = array('1', "haixiao");
$sql = prepare($sql_pre, $array);
return get_line($sql);
}
示例2: get_law_by_id
function get_law_by_id($caseid)
{
$sql_pre = "SELECT `id` , `title` , `lawcat` , `time` , `content` FROM `yxy_laws` WHERE `id` = ?i ";
$array = array($caseid);
$sql = prepare($sql_pre, $array);
return get_line($sql);
}
示例3: get_master_info
function get_master_info($username)
{
$sql_pre = "SELECT `username` , `password` FROM `yxy_master` WHERE `username` = ?s";
$array = array($username);
$sql = prepare($sql_pre, $array);
return get_line($sql);
}
示例4: get_admin_info_by_id
function get_admin_info_by_id($id)
{
$sql = "SELECT * FROM `admin` WHERE `admin_id` = '" . intval($id) . "' LIMIT 1";
if ($line = get_line($sql)) {
return $line;
}
return false;
}
示例5: modif_field
function modif_field()
{
echo "What do you want to update?\n> ";
$arr = array("age", "name", "email", "phone");
$field = get_line();
while (!in_array($field, $arr)) {
echo "Erreur: age/name/email/phone.\n";
echo "What do you want to update?\n> ";
$field = get_line();
}
return $field;
}
示例6: confirm
function confirm()
{
echo "Are you sure ?\n> ";
$conf = get_line();
while (preg_match_all("/^oui|yes|no|non\$/i", $conf) != 1) {
echo "Erreur: Oui / Yes / Non / No.\n";
echo "Are you sure ?\n> ";
$conf = get_line();
}
if (preg_match_all("/^oui|yes\$/i", $conf) == 1) {
return TRUE;
} else {
return FALSE;
}
}
示例7: get_number
function get_number($new = 0)
{
if ($new == 1) {
$phrase = "New phone number ?\n> ";
} else {
$phrase = "Phone number ?\n> ";
}
echo $phrase;
$number = get_line();
while (preg_match("/^[0-9]{10}\$/i", $number) !== 1) {
echo "Erreur: Numéro invalide.\n";
echo $phrase;
$number = get_line();
}
return $number;
}
示例8: plugin_simple_token
function plugin_simple_token()
{
$do = z(t(v('do')));
switch ($do) {
case 'create':
case 'refresh':
$new_token = substr(md5(uid() . time("Y h j G") . rand(1, 9999)), 0, rand(9, 20));
$new_token = uid() . substr(md5($new_token), 0, 10);
$sql = "REPLACE INTO `stoken` ( `uid` , `token` , `on` ) VALUES ( '" . intval(uid()) . "' , '" . s($new_token) . "' , '1' )";
run_sql($sql);
if (db_errno() == 0) {
return ajax_echo('done');
} else {
return ajax_echo('error');
}
break;
case 'close':
$sql = "UPDATE `stoken` SET `on` = '0' WHERE `uid` = '" . intval(uid()) . "' LIMIT 1";
run_sql($sql);
if (db_errno() == 0) {
return ajax_echo('done');
} else {
return ajax_echo('error');
}
break;
case 'reopen':
$sql = "UPDATE `stoken` SET `on` = '1' WHERE `uid` = '" . intval(uid()) . "' LIMIT 1";
run_sql($sql);
if (db_errno() == 0) {
return ajax_echo('done');
} else {
return ajax_echo('error');
}
break;
default:
$data['tinfo'] = get_line("SELECT * FROM `stoken` WHERE `uid` = '" . intval(uid()) . "' LIMIT 1");
render($data, 'ajax', 'plugin', 'simple_token');
}
}
示例9: get_line
function get_line($date, $epg_lines, $line_num)
{
$epg_line = @trim($epg_lines[$line_num]);
preg_match("/(\\d+):(\\d+)[\\s\t]*([\\S\\s]+)/", $epg_line, $tmp_line);
if (@$tmp_line[1] && $tmp_line[2] && $tmp_line[3]) {
$result = array();
$time = $date . ' ' . $tmp_line[1] . ':' . $tmp_line[2] . ':00';
$result['time'] = $time;
//$result['name'] = addslashes($tmp_line[3]);
$result['name'] = $tmp_line[3];
$next_line = get_line($date, $epg_lines, $line_num + 1);
if (!empty($next_line)) {
$time_to = $next_line['time'];
$result['time_to'] = $time_to;
$result['duration'] = strtotime($time_to) - strtotime($time);
} else {
$result['time_to'] = 0;
$result['duration'] = 0;
}
return $result;
}
return false;
}
示例10: login
public function login()
{
$u = t(v('uname'));
$p = t(v('psw'));
if (true !== $this->loginCheck($u, $p)) {
return ajax_json(array('title' => '登录失败:', 'status' => 1, 'msg' => '用户名或者密码错误!'));
}
// $p=md5(v('psw'));
$sql = "select name from admin_user as u where u.name=" . s($u);
$result = get_line($sql);
//var_dump($result);
if (!$result) {
return ajax_json(array('title' => '登录失败:', 'status' => 1, 'msg' => '用户名或者密码错误1!'));
} elseif ($result['status'] == 'delete') {
return ajax_json(array('title' => '登录失败:', 'status' => 1, 'msg' => '用户已经被封禁!'));
} elseif ($result['status'] == 'active') {
ss_set('uid', $result['id']);
ss_set('email', $result['email']);
ss_set('nickname', $result['nickname']);
ss_set('uname', $u);
admin_log($result['id'], "登录后台管理系统.");
return ajax_json(array('title' => '登录成功:', 'status' => 0, 'msg' => '您已成功登录!'));
}
}
示例11: trigger_error
} else {
trigger_error("You can only run this script from the command line\n", E_USER_ERROR);
}
if (empty($SYSTEM_ROOT)) {
echo $err_msg;
exit;
}
if (!is_dir($SYSTEM_ROOT) || !is_readable($SYSTEM_ROOT . '/core/include/init.inc')) {
echo "ERROR: Path provided doesn't point to a Matrix installation's System Root. Please provide correct path and try again.\n";
exit;
}
require_once $SYSTEM_ROOT . '/core/include/init.inc';
echo "Note: data/public/test_message.php has been moved to core/lib/web/test_message.php as a result of RM #5722\n";
$confirm = null;
while ($confirm != 'y' && $confirm != 'n') {
$confirm = strtolower(get_line('Delete data/public/test_message.php? (y/n)? : '));
if ($confirm != 'y' && $confirm != 'n') {
echo 'Please answer y or n' . "\n";
}
}
if ($confirm == 'y') {
echo "Removing..";
$file_path = $SYSTEM_ROOT . '/data/public/test_message.php';
if (is_file($file_path)) {
unlink($file_path);
}
echo "done.\n";
}
/**
* Prints the specified prompt message and returns the line from stdin
*
示例12: login_check
public function login_check()
{
$email = z(t(v('email')));
$password = z(t(v('password')));
if (strlen($email) < 1 || strlen($password) < 1) {
return ajax_echo("电子邮件和密码不能为空");
}
$sql = "SELECT `id` , `email` FROM `__meta_user` WHERE `email` = '" . s($email) . "' AND `password` = '" . md5($password) . "'";
if (!($user = get_line($sql))) {
return ajax_echo("电子邮件和密码不匹配,请重试");
}
$_SESSION['uid'] = $user['id'];
$_SESSION['email'] = $user['email'];
$_SESSION['ulevel'] = 9;
// do login
return ajax_echo("成功登录,转向中…<script>location = '?a=index';</script>");
}
示例13: while
echo "ERROR: You need to supply the path to the System Root as the first argument\n";
exit;
}
if (!is_dir($SYSTEM_ROOT) || !is_readable($SYSTEM_ROOT . '/core/include/init.inc')) {
echo "ERROR: Path provided doesn't point to a Matrix installation's System Root. Please provide correct path and try again.\n";
exit;
}
require_once $SYSTEM_ROOT . '/core/include/init.inc';
$root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
$GLOBALS['SQ_SYSTEM']->setCurrentUser($root_user);
echo "\n";
$GLOBALS['SQ_SYSTEM']->changeDatabaseConnection('db2');
$db =& $GLOBALS['SQ_SYSTEM']->db;
$action = NULL;
while ($action != 'add' && $action != 'remove') {
$action = get_line('Please specify whether you want to \'add\' or \'remove\' a URL: ');
}
require_once $SYSTEM_ROOT . '/scripts/url_manager.inc';
if ($action == 'add') {
$inputs = URL_Manager::cliInterfaceAddUrl();
$queries = URL_Manager::addUrl($inputs['http'], $inputs['https'], $inputs['new_url'], $inputs['existing_url'], $inputs['siteid'], $inputs['update_file_public_live_assets'], $inputs['existing_urlid'], $SYSTEM_ROOT);
} else {
if ($action == 'remove') {
$remove_url_info = URL_Manager::cliInterfaceRemoveUrl();
$queries = URL_Manager::removeUrl($remove_url_info['remove_urlid'], $remove_url_info['remove_assetid'], $remove_url_info['remove_url'], FALSE, $SYSTEM_ROOT);
}
}
//end else if
$GLOBALS['SQ_SYSTEM']->restoreDatabaseConnection();
$GLOBALS['SQ_SYSTEM']->restoreCurrentUser();
exit(0);
示例14: plugin_check_mail
function plugin_check_mail()
{
if (intval(kget('mqueue_on')) != 1) {
return false;
}
$sql = "SELECT * FROM `mail_queue` WHERE `timeline` > '" . date("Y-m-d H:i:s", strtotime("-1 hour")) . "' LIMIT 1";
if ($line = get_line($sql)) {
session_write_close();
$info = unserialize($line['data']);
if (phpmailer_send_mail($info['to'], $info['subject'], $info['body'], kget('mqueue_username'), kget('mqueue_server'), kget('mqueue_port'), kget('mqueue_username'), kget('mqueue_password'))) {
$sql = "DELETE FROM `mail_queue` WHERE `id` = '" . intval($line['id']) . "' LIMIT 1";
} else {
$sql = "UPDATE `mail_queue` SET `timeline` = '" . date("Y-m-d H:i:s", strtotime("-2 hours")) . "' LIMIT 1 ";
}
run_sql($sql);
}
include_once AROOT . 'controller' . DS . 'api.class.php';
if (db_errno() != 0) {
apiController::send_error(LR_API_DB_ERROR, 'DATABASE ERROR ' . db_error());
}
return apiController::send_result(array('to_send' => get_var("SELECT COUNT(*) FROM `mail_queue` WHERE `timeline` > '" . date("Y-m-d H:i:s", strtotime("-1 hour")) . "' ")));
}
示例15: get_var
function get_var($sql, $db = NULL)
{
$data = get_line($sql, $db);
return $data[@reset(@array_keys($data))];
}