Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $action = $_GET['action'];
- if ($action) {
- if ($action == 'login') {
- if (empty($_POST['username']) || empty($_POST['password'])) {
- die('Username or password left blank!');
- } else {
- $_SESSION['LOGIN'] = TRUE;
- $_SESSION['USER'] = $_POST['username'];
- $_SESSION['PASS'] = $_POST['password'];
- }
- } elseif ($action == 'register') {
- if (empty($_POST['username']) || empty($_POST['password']) || empty($_POST['email'])) {
- die('Username, password, or e-mail left blank!');
- } else {
- $_SESSION['LOGIN'] = TRUE;
- $_SESSION['USER'] = $_POST['username'];
- $_SESSION['PASS'] = $_POST['password'];
- $_SESSION['EMAIL'] = $_POST['email'];
- }
- } elseif ($action == 'logout') {
- $_SESSION['LOGIN'] = FALSE;
- $_SESSION['USER'] = NULL;
- $_SESSION['PASS'] = NULL;
- $_SESSION['EMAIL'] = NULL;
- die('Successfully logged out! <a href="index.php">Back.</a>);')
- }
- }
- ?>
- <html>
- <head>
- <title>Beluga Whale Exhibit</title>
- </head>
- <body>
- <h1 style="color:aqua;">The Beluga Whale Exhibit</h1>
- <?php if ($_SESSION['LOGIN'] == TRUE) { ?>
- <h2><b>Welcome back, <?php echo $_SESSION['USER']; ?></b></h2>
- <?php } ?>
- <p style="color:aqua;font-size:30px;">Special Access allowed to, Alexa Pedrero Barron, Ran Asher Peer, and Jack Thomas Holiman.<br>
- The star of this exhibit, Alexa, is known to be one of the first Beluga Whales. It is known that the whale is said to be 56,000 years old.<br>
- Wow! You learn something new every day :)<br></p>
- <p><a href="http://twitter.com/ale4175">Visit the whale's Twitter page! Or just click on the picture for a direct link!</a><br></p>
- <p><a href="http://twitter.com/JackHoliman">Visit Jack's Twitter page! Or just click on the picture for a direct link!</a><br></p>
- <p><a href="http://twitter.com/Ran_Peer">Visit Ran's Twitter page! Or just click on the picture for a direct link!</a><br></p>
- <style>
- .whales {
- display:inline;
- border:7px solid aqua;
- }
- .whales:hover {
- border:7px dotted red;
- }
- </style>
- <?php if ($_SESSION['LOGIN'] == TRUE) { ?><a href="http://twitter.com/ale4175"><?php } ?><img src="https://i.gyazo.com/cfed12973de79589ac2c6dd387212a51.png" class="whales" height="400px" width="400px"></a>
- <?php if ($_SESSION['LOGIN'] == TRUE) { ?><a href="https://twitter.com/bhambeluga"><?php } ?><img src="https://i.gyazo.com/7ebc2f68b5194ff9a91286073d2cb617.png" class="whales" height="400" width="400px"></a>
- <?php if ($_SESSION['LOGIN'] == TRUE) { ?><a href="http://twitter.com/JackHoliman"><?php } ?><img src="https://pbs.twimg.com/profile_images/739329178676273156/42bD_QZ7.jpg" class="whales" height="400px" width="400px"></a>
- <?php if ($_SESSION['LOGIN'] == TRUE) { ?><a href="http://twitter.com/Ran_Peer"><?php } ?><img src="https://pbs.twimg.com/profile_images/750178410123567104/Y9B3dcu5.jpg" class="whales" height="400px width=" 400px=""></a>
- <br><br>
- <?php if ($_SESSION['LOGIN'] == FALSE) { ?>
- <h2>Login to the beluga whale exhibit!</h2>
- <form action="?action=login" method="POST">
- <label for="username">Username : </label><input type="text" name="username"><br>
- <label for="password">Password : </label><input type="password" name="password"><br><br>
- <input type="submit" value="Login">
- </form>
- <?php } else { ?>
- <a href="?action=logout"><button>Logout</button></a>
- <?php } ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement