Commit 395348b4 authored by Sorrel Harriet's avatar Sorrel Harriet
Browse files

Merge branch 'master' of gitlab.doc.gold.ac.uk:data-networks-web/lab-exercises

parents 1c597e3d 30469a08
......@@ -5,9 +5,9 @@
// define a connection 'handle'
$link = mysqli_connect(
'localhost',
'USERNAME',
'PASSWORD',
'DATABASE_NAME'
'sharr003',
'password123',
'sharr003_musicstore'
);
// check connection succeeded
......
......@@ -3,9 +3,9 @@
// define a connection 'handle'
$link = mysqli_connect(
'localhost',
'sorrel',
'password123',
'hangman'
'USERNAME',
'PASSWORD',
'DB_NAME'
);
// check connection succeeded
......
......@@ -31,6 +31,7 @@ if ($row_cnt == 0) {
// otherwise set a variable with their name
while ($row = mysqli_fetch_assoc($result)) {
$forename = $row['forename'];
$username = $row['username'];
}
// free result set
......@@ -39,6 +40,7 @@ if ($row_cnt == 0) {
// update content
$content .= "<h1>Welcome to Hang Man $forename!</h1>";
$content .= "<p>An exciting word game for 1 player.</p>";
$content .= "<p>You are playing as <strong>$username</strong></p>";
}
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment