Webbserverprogrammering 1

Show sourcecode

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

webbserverprogrammering/projekt/snake_oil_seller/php/

about_us.php
add_to_cart.php
admin.php
buy_cart.php
config.php
contact.php
create_products.php
create_tables.php
createtable.php
dbconnection.php
delete_post.php
delete_tables.php
deletepost.php
deletetable.php
entry.php
header.php
insert_posts.php
insertposts.php
leaderboard.php
log_in.php
log_out.php
main.php
my_account.php
question_maker.php
quiz_form.php
quiz_list.php
quiz_maker.php
result.php
select_posts.php
selectposts.php
shop.php
shop_item.php
shopping_cart.php
sign_in.php
title_card.php
update_posts.php
updateposts.php
user_verified.php
verify_page.php

delete_tables.php

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

<body>
<?php
  
/** @var PDO $dbconn*/
    
include ("dbconnection.php");
  try {
    
// sql to delete tables
    
$sql "DROP TABLE IF EXISTS users, product_classes, product_items, orders, order_items";
    
//use exec() because no results are returned
    
$dbconn->exec($sql);
    echo 
"All tables deleted successfully";
  }
  catch(
PDOException $e)
      {
      echo 
$sql "<br>" $e->getMessage();
  }

  
//Rensa kopplingen till databasen
  
$dbconn null;
?>
</body>
</html>