本文整理汇总了PHP中Api::login方法的典型用法代码示例。如果您正苦于以下问题:PHP Api::login方法的具体用法?PHP Api::login怎么用?PHP Api::login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Api
的用法示例。
在下文中一共展示了Api::login方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
public function login()
{
// we store all the apis in a variable
if (isset($_POST['phonenumber']) && $_POST['password']) {
$phonenumber = $_POST['phonenumber'];
$password = $_POST['password'];
}
$api = Api::login('4444444444', '@abc');
print json_encode($api);
}
示例2: Api
<?php
session_start();
require_once 'Api.php';
if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
$api = new Api();
$result = $api->login($username, $password);
if ($result != false) {
//if a string is returned (admin/basic) then set the session
$_SESSION['userType'] = $result;
header("Location: index.php");
} else {
//header("Location: login.php");
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
include 'htmlhead.php';
?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="css/logincss.css" type="text/css" media="screen" title="default" />
示例3: var_dump
<?php
require_once 'Api.php';
$api = new Api();
//Testing for login
echo '***********************************************';
echo ' USER ';
echo "*********************************************** ";
$result = $api->login('Tbee', 'resah');
echo var_dump($result) . "Login working:";
$resultu1 = $api->login('Tbee2', 'resah');
echo " Login not working : " . var_dump($resultu1);
$resultu2 = $api->registerUser('Resah', 'Jones', 'resss01', 'angelbaby@hotmail.com', 5334430, ' hottaz');
echo " register: " . var_dump($resultu2);
echo '***********************************************';
echo ' Book ';
echo "***********************************************\n";
//$resultb1 = $api->addBook('life', 'Dean','TaraPub','Direct','2009-01-03','1','computing','mint','10',
// 'computing book for sale','1','book',' 2009-01-03 11:48:50','time,uu','path/to/image');
//var_dump($resultb1);
$resultb2 = $api->getownerBooks('1');
var_dump($resultb2);
//$resultb5 = $api->editbook($itemid, $title, $author, $publisher, $published_date, $edition, $subjectarea, $condition, $saletype, $askingprice, $description);
//var_dump($resultb5;)
$resultb3 = $api->rmbook('8');
var_dump($resultb3);