Webbserverprogrammering 1

Show sourcecode

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

webbserverprogrammering/projekt/snake_oil_seller/php/

about_us.php
admin.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

header.php

84 lines UTF-8 Windows (CRLF)
<?php
  
// Kollar och ändrar vald flik beroende på vald sida
  
$currentPage basename($_SERVER["PHP_SELF"]);

  if (
$currentPage === "main.php") {
    echo 
'
    <div id="rubrics">
      <a href="main.php"style="font-weight: bold; font-size: 1.5em;">Main</a>
      <a href="shop.php">Shop</a>
      <a href="about_us.php">About us</a>
      <a href="contact.php">Contact</a>
      <a href="shopping_cart.php">Shopping cart</a>
      <a href="my_account.php">My account</a>
      <a href="log_out.php">Lämna sidan</a>
    </div>'
;

  } else if (
$currentPage === 'shop.php') {
    echo 
'
    <div id="rubrics">
      <a href="main.php">Main</a>
      <a href="shop.php" style="font-weight: bold;  font-size: 1.5em;">Shop</a>
      <a href="about_us.php">About us</a>
      <a href="contact.php">Contact</a>
      <a href="shopping_cart.php">Shopping cart</a>
      <a href="my_account.php">My account</a>
      <a href="log_out.php">Lämna sidan</a>
    </div>'
;
  } else if (
$currentPage === 'about_us.php') {
    echo 
'
    <div id="rubrics">
      <a href="main.php">Main</a>
      <a href="shop.php">Shop</a>
      <a href="about_us.php" style="font-weight: bold; font-size: 1.5em;">About us</a>
      <a href="contact.php">Contact</a>
      <a href="shopping_cart.php">Shopping cart</a>
      <a href="my_account.php">My account</a>
      <a href="log_out.php">Lämna sidan</a>
    </div>'
;
  } else if (
$currentPage === 'contact.php') {
    echo 
'
    <div id="rubrics">
      <a href="main.php">Main</a>
      <a href="shop.php">Shop</a>
      <a href="about_us.php">About us</a>
      <a href="contact.php" style="font-weight: bold; font-size: 1.5em;">Contact</a>
      <a href="shopping_cart.php">Shopping cart</a>
      <a href="my_account.php">My account</a>
      <a href="log_out.php">Lämna sidan</a>
    </div>'
;
  } else if (
$currentPage === 'shopping_cart.php') {
    echo 
'
    <div id="rubrics">
      <a href="main.php">Main</a>
      <a href="shop.php">Shop</a>
      <a href="about_us.php">About us</a>
      <a href="contact.php">Contact</a>
      <a href="shopping_cart.php" style="font-weight: bold; font-size: 1.5em;">Shopping cart</a>
      <a href="my_account.php">My account</a>
      <a href="log_out.php">Lämna sidan</a>
    </div>'
;
  } else if (
$currentPage === 'my_account.php') {
    echo 
'
    <div id="rubrics">
      <a href="main.php">Main</a>
      <a href="shop.php">Shop</a>
      <a href="about_us.php">About us</a>
      <a href="contact.php">Contact</a>
      <a href="shopping_cart.php">Shopping cart</a>
      <a href="my_account.php" style="font-weight: bold; font-size: 1.5em;">My account</a>
      <a href="log_out.php">Lämna sidan</a>
    </div>'
;
  } else if (
$currentPage === 'shop_item.php') {
    echo 
'
    <div id="rubrics">
      <a href="main.php">Main</a>
      <a href="shop.php">Shop</a>
      <a href="about_us.php">About us</a>
      <a href="contact.php">Contact</a>
      <a href="shopping_cart.php">Shopping cart</a>
      <a href="my_account.php"">My account</a>
      <a href="log_out.php">Lämna sidan</a>
    </div>'
;
  }
?>