Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Party class modifyed to include _leader variable and edited killcheck() function to update leader. -gameover used to give short gameover dialouge -gameover2 provides database functionality and clears session. Not particuarlly well-tested, may need to be tested with proper datebase connection. -closses issue #28: Make gameover.php
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
include "classes.php"; | ||
session_start(); | ||
|
||
include "commonUI.php"; | ||
startHTML("Game Over"); | ||
|
||
$location = $_SESSION["playerJourney"]->_distance; | ||
$leader = $_SESSION["playParty"]->_leader; | ||
?> | ||
<p> | ||
Here Lies <?php echo $leader; ?><br> | ||
You died <?php echo $location; ?> miles along the path.<br> | ||
You were <?php echo 2000 - $location; ?> miles from your goal<br> | ||
|
||
What would you like on your tombstone? | ||
<form action="gameover2.php"> | ||
<input type = "text" name="message"> | ||
<input type = "submit" value="Enter"> | ||
</form> | ||
|
||
</p> | ||
|
||
|
||
|
||
<?php | ||
endHTML(); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
include "classes.php"; | ||
session_start(); | ||
include "scoresAndDeaths.php"; | ||
include "commonUI.php"; | ||
startHTML("inbetween"); | ||
?> | ||
|
||
<meta http-equiv="refresh" content="0; url= index.php" /> | ||
|
||
<?php | ||
|
||
$leader = $_SESSION["playParty"]->_leader; | ||
$location = $_SESSION["playerJourney"]->_distance; | ||
$message = $_GET["$message"]; | ||
$month = $_SESSION["playerJourney"]->_month; | ||
$day = $_SESSION["playerJourney"]->_date; | ||
|
||
|
||
|
||
$otd = new OregonTrailDatabase("eritte2","eritte2"); | ||
$conn = $otd->connect(); | ||
if ($conn) | ||
{ | ||
$otd->addDeath($leader, $location, $message, $month, $day); | ||
} | ||
erase_session(); | ||
endHTML(); | ||
?> |