示例#1
0
<?php

require "dbconnection.php";
$posNumber = $_POST['number'];
$posPassword = $_POST['password'];
$suc = false;
$userId = checkLoginForUser($posNumber, $posPassword);
if ($userId > 0) {
    session_start();
    $_SESSION['loggedIn'] = true;
    $suc = true;
}
header("content-type: text/javascript");
if ($suc) {
    echo 'userInfo =createUserInfo(mobileNumber);
 		         userId = ' . $userId . ';
 		         setCookie("userId",userId,7);
	             contactList = createContactList();
  				';
} else {
    echo 'setInfoMessage("Wrong number or password!","info_message_warning");';
}
示例#2
0
    </thead>
    <tr>
        <td>Test Case: User login</td>
        <td><?php 
if (checkLoginForUser('84d89877f0d4041efb6bf91a16f0248f2fd573e6af05c19f96bedb9f882f7882', '050f993ea2322d4b6940f8560a253a11709fdc5ab08fd994bceb096846ea1645')) {
    echo "checkLoginForUser(): correct input </td><td> <span class='success' style='color:green'>successful</span><br></td>";
} else {
    echo "(): correct input </td><td> <span class='notsuccess' style='color:red'>not successful</span><br></td>";
}
?>
</td>
    </tr>
    <tr>
        <td>Test Case: User login</td>
        <td><?php 
if (checkLoginForUser(' ', ' ') == false) {
    echo "checkLoginForUser(): wrong input </td><td> <span class='success' style='color:green'>successful</span><br></td>";
} else {
    echo "checkLoginForUser(): wrong input </td><td> <span class='notsuccess' style='color:red'>not successful</span><br></td>";
}
?>
    </tr>
</table>

<h2>Test Case: Registration</h2>
<table border="2px">
    <thead>
    <tr>
        <td>Test Case</td>
        <td>Detail</td>
        <td>Status</td>