コード例 #1
0
}
//If ID is not set, then exit with message
if (!isset($id)) {
    echo "E-Mail {$email} does not exist";
}
//Create a random password
$password = generateRandomString('5');
echo $password;
//Hash the password provided
$hash = encryptPassword($password);
//Save new password for user
//If already exists, then update password and if not insert record
$params = array();
$response = null;
$params = add_where('idPerson', $id, $params);
$response = select_from_table('password', 'idPerson', $params);
//echo $response;
if (empty(json_decode($response, true))) {
    //Insert
    $record = array();
    $records = array();
    $record = add_field('idPerson', $id, $record);
    $record = add_field('password', $hash, $record);
    $record = add_field('misses', "0", $record);
    $record = add_field('locked', "0", $record);
    array_push($records, $record);
    insert_into_table('password', $records);
} else {
    //Modify
    $update = array();
    $where = array();
コード例 #2
0
ファイル: index.php プロジェクト: t-initi/DBManagement
		
			<div id="rightdiv">
			<h2 class='titleA' >Retour d'une Location</h2>
			<?php 
include './depotformulaire.php';
?>
				
			</div>
			
			<div id="bttdiv"  style='background: color;' >
			<h2 class='titleA'>test</h2>
			<?php 
if (isset($_GET['search'])) {
    if (!empty($_GET['code'])) {
        $code = $_GET['code'];
        select_from_table($code);
    }
}
?>
				
			</div>
			<div id='bottomDiv'></div>
			
			
			
		</div>
	
	</div>

</body>
</html>
コード例 #3
0
<?php

require_once '..\\utilities\\functions.php';
header('Access-Control-Allow-Origin: *');
$where = array();
$table = null;
$fields = "all";
while ($value = current($_GET)) {
    $key = key($_GET);
    switch ($key) {
        case 'table':
            $table = $value;
            break;
        case 'fields':
            $fields = $value;
            break;
        default:
            $where = add_where($key, $value, $where);
            break;
    }
    next($_GET);
}
$response = select_from_table($table, $fields, $where);
echo $response;
コード例 #4
0
<?php

require_once '..\\utilities\\functions.php';
header('Access-Control-Allow-Origin: *');
$where = $_get();
// List fields or define field as NULL
$fields = array("namelast", "namefirst", "email");
//$fields = null;
$response = select_from_table('person', $fields, $where);
echo $response;