Webbserverprogrammering 1

Källkod

Följande filer och mappar finns under mappen webbserverprogrammering.
Mappar visas till vänster och filer till höger. Klicka på en fil eller mapp för att öppna nedan eller visa dess innehåll.

webbserverprogrammering/projects/quiz-extended/

26 filer

admin.php
confirm_account.php
create_account.php
create_quiz.php
css/
dbconnection.php
highscore.php
index.php
js/
logbook.php
login.php
mysql_create_table_options.php
mysql_create_table_questions.php
mysql_create_table_quizzes.php
mysql_create_table_results.php
mysql_create_table_submits.php
mysql_create_table_users.php
plan.php
planering.txt
profile.php
projektrapport.txt
quizzes.php
resources/
result.php
send_email.php
session_variable_array_check.php

dbconnection.php

21 lines ASCII Windows (CRLF)
<?php
$dbname 
'vgydummy06';
$hostname 'localhost';
$
/* DB_USER, is removed and hidden for security reasons */ ;
$
/* DB_PASSWORD, is removed and hidden for security reasons */ ;
$options  = array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'");

try {
 
$dbconn = new PDO("mysql:host=$hostname;dbname=$dbname;", $/* DB_USER, is removed and hidden for security reasons */ ;
 $
/* DB_PASSWORD, is removed and hidden for security reasons */ ;
 
$dbconn->setAttribute(PDO::ATTR_ERRMODEPDO::ERRMODE_EXCEPTION);
 
/*** echo a message saying we have connected ***/
 // echo 'Connected to database.<br />';
}
catch(
PDOException $e){
 
// For debug purpose, shows all connection details
 
echo 'Connection failed: '.$e->getMessage()."<br />";
 
// Hide connection details.
 //echo 'Could not connect to database.<br />'); 
}
?>