Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbserverprogrammering/projekt/quiz/

createtable.php
dbconnection.php
deletepost.php
deletetable.php
insertdefaultposts.php
insertposts.php
leaderboard.php
log_in.php
log_out.php
main.php
question_maker.php
quiz_form.php
quiz_list.php
quiz_maker.php
result.php
selectposts.php
sign_in.php
style.js
updateposts.php

deletetable.php

30 lines ASCII Windows (CRLF)
<!-- deletetable.php -->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Create</title>
</head>

<body>
<?php
include ('dbconnection.php');
try {

    
// sql to delete table
    
$sql "DROP TABLE IF EXISTS quiz_users";
    
//use exec() because no results are returned
    
$dbconn->exec($sql);
    echo 
"Table deleted successfully";
}
catch(
PDOException $e)
    {
    echo 
$sql "<br>" $e->getMessage();
}

//Rensa kopplingen till databasen
$dbconn null;

?>
</body>
</html>