You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
461 B
23 lines
461 B
|
|
|
|
<?php
|
|
|
|
require_once('SqliteDb.php');
|
|
|
|
|
|
$db = new SqliteDb();
|
|
$db->exec('DROP TABLE Correct');
|
|
$db->exec('CREATE TABLE Correct (question STRING, reponse STRING)');
|
|
$db->exec("INSERT INTO Correct VALUES ('Ceci est la question 1 ', 'réponse 1')");
|
|
|
|
$reponseUser = $_POST['R1'];
|
|
$reponseDb = $db->querySingle('SELECT reponse FROM Correct');
|
|
|
|
if ($reponseDb == $reponseUser) {
|
|
echo 'Bonne réponse !';
|
|
} else {
|
|
echo 'Mauvaise réponse !';
|
|
}
|
|
|
|
|