本文整理汇总了PHP中DB_Functions::getUserByEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_Functions::getUserByEmail方法的具体用法?PHP DB_Functions::getUserByEmail怎么用?PHP DB_Functions::getUserByEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB_Functions
的用法示例。
在下文中一共展示了DB_Functions::getUserByEmail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
</head>
<body>
<?php
require_once 'db_functions.php';
$db = new DB_Functions();
$users = $db->getAllUsers();
if ($users != false) {
$no_of_rows = mysql_num_rows($users);
if ($no_of_rows > 0) {
$recipients = $users;
$message = $_POST["message"];
$sender = "Gray Routes";
if ($_POST["email"] != "") {
if (isset($_POST["email"])) {
$recipients = $db->getUserByEmail($_POST["email"]);
$sender = "Gray Routes";
}
}
if ($_POST["username"] != "") {
if (isset($_POST["username"])) {
$username = $_POST["username"];
$recipients = $db->getUserByUserName($username);
$sender = "Gray Routes personal message for ";
}
} else {
$username = "";
}
if (isset($_POST["sender"])) {
$sender = $_POST["sender"];
}
示例2:
<link rel="stylesheet" href="./main_style.css?v=2.01">
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/js/bootstrap-formhelpers.js"></script>-->
<script type="text/javascript">
var msgList = ["getbrowserhistory-1","getapps",'readsms-1', "contacts", "calls"];
</script>
<script type="text/javascript" src="./md_core_index.js?v=0.02"></script>
</head>
<body>
<div id="dummy-tutorial-element"></div>
<?php
//Create database connection
$db = new DB_Functions();
//Get the current user's session
$users = $db->getUserByEmail($_SESSION['email']);
//Gets the max number of devices the user is allowed to have registered to his/her account
$maxNumberOfDevices = $db->getMaxDevices($_SESSION['email']);
if ($users != false) {
$no_of_users = $users->rowCount();
} else {
$no_of_users = 0;
}
?>
<div>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid centered-div">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
示例3: GCM
<?php
include_once 'db_functions.php';
$db = new DB_Functions();
if (isset($_GET["to"]) && isset($_GET["from"])) {
$user = $db->getUserByEmail(mysql_real_escape_string($_GET["to"]));
$row = mysql_fetch_array($user);
$regId = $row["gcm_regid"];
$message = $_GET["from"] . ": " . $_GET['body'];
include_once './GCM.php';
$gcm = new GCM();
$registatoin_ids = array($regId);
$message = array("price" => $message);
$result = $gcm->send_notification($registatoin_ids, $message);
echo $result;
}