- Untitled
- Saturday, September 16th, 2006 at 11:03:14pm UTC
- <?php include('header.php'); ?>
- <?php
- $chickens_are_real = "duck";
- $cows_are_real = "petrie";
- if(isset($_POST['submit'])) {
- if($_POST['admin'] == $chickens_are_real && $_POST['password'] == $cows_are_real){
- $admin = $_POST['admin'];
- $pass = $_POST['password'];
- session_start();
- $admin = addslashes($admin);
- $pass = addslashes($pass);
- $_SESSION['admin'] = $admin;
- $_SESSION['password'] = $pass;
- }
- }
- if($_POST['submit']){
- if($_POST['admin'] == $chickens_are_real && $_POST['password'] == $cows_are_real){
- session_start();
- if(!isset($_SESSION['admin'])){
- echo 'You are not <a href="/admin_login.php">logged in</a>.';
- }
- echo "The login name and password were correct. You may now access the following Admin Areas:<br /><ul><li><a href=\"/news/index.php?action=addnews129\">Adding News</a></li></ul>More items will be added at a later time...";
- }
- else{
- echo "<center><h3>Error</h3></center>";
- echo "<p>The login name or password was not correct.";
- }
- }
- elseif($_GET['actn'] == "test"){
- session_start();
- $admin = $_SESSION['admin'];
- $pass = $_SESSION['password'];
- echo "$admin is your admin name.<br />\n";
- echo "$pass is you password.";
- }
- else{
- ?>
- <center><h3>Admin Login</h3>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" />
- Admin:<br />
- <input type="text" name="admin" /><br />
- Password:<br />
- <input type="password" name="password" /><br />
- <input type="submit" value=" Submit " name="submit" />
- <input type="hidden" value="submit" name="submit" />
- </form>
- </center>
- <?php
- }
- ?>
- <?php include('footer.php'); ?>
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.