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
title_card.php
36 lines UTF-8 Windows (CRLF)
<h1 style="font-size:3em;">Snake Oil Seller</h1>
<style>
#welcome_sign {
font-size: 1.5em;
color: rgb(230, 126, 34);
margin-bottom: 2vh;
}
</style>
<?php
// Skriver ut admin information (temporärt)
$is_logged_in = false;
if (isset( $_SESSION["username"], $_SESSION["usertype"], $_SESSION["is_verified"])) {
$username = $_SESSION["username"];
$usertype = $_SESSION["usertype"];
$is_verified = $_SESSION["is_verified"];
// Hämtar id från namnet
$fetch_id = $dbconn->prepare("SELECT id FROM users WHERE username = ?");
$fetch_id->execute([$username]);
$result = $fetch_id->fetch(PDO::FETCH_ASSOC);
$id = $result["id"];
// Hämtar emailen
$stmt = $dbconn->prepare("SELECT email FROM users WHERE username = ?");
$stmt->execute([$username]);
$user = $stmt->fetch(PDO::FETCH_ASSOC);
$email = $user["email"];
$is_logged_in = true;
echo "<div id='welcome_sign'>Welcome $username</div>";
}
?>