Webbserverprogrammering 1

Show sourcecode

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

webbserverprogrammering/projekt/snake_oil_seller/

about_us.php
admin.php
contact.php
create_products
createtable.php
css/
dbconnection.php
deletepost.php
deletetable.php
entry.php
header.php
insertposts.php
js/
leaderboard.php
log_in.php
log_out.php
main.php
my_account.php
php/
question_maker.php
quiz_form.php
quiz_list.php
quiz_maker.php
result.php
selectposts.php
shop.php
shopping_cart.php
sign_in.php
snake_oil.css
style.js
title_card.php
updateposts.php
user_verified.php
verify_page.php

deletetable.php

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

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

    
// sql to delete table
    
$sql "DROP TABLE IF EXISTS snake_oil_seller";
    
//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>