Okay, bring up notepad or whatever text editor you use and paste this code into it:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<?php
//EDITABLE -->
$title[0] = "Please Log In.";
$title[1] = "Access Restrictions.";
$title[2] = "Your moma bakes gravy for lepars.";
$title[3] = "OMFG IM PASSWORDED SINCE WHEN?!";
$username = "username";
$password = "password";
//NO MORE -->
if(isset($_POST['tuser']) && isset($_POST['tpass'])){
$user = $_POST['tuser']; $pass = $_POST['tpass'];
if($user=="" || $pass==""){
$error = $error."You left a field or fields blank.<br/>";
} else {
if($user=="" && $pass==""){
$error = $error."You left both fields blank.";
}
}
$user = md5($user); $pass = md5($pass);
//if both user and pass exist, log in!
if($user !=="" && $pass!==""){
if($user == md5($username) && $pass == md5($password)){
$loggedin = true;
} else {
$error = $error."Invalid username or password.";
}
}
}
$maxarray = count($title)-1;
$choice = rand(0,$maxarray);
echo "<title>".$title[$choice]."</title>";
if(!$loggedin){?>
<style type='text/css'>
body {
background: #a0a0a0;
font-family: verdana;
}
<? } ?>
<?// IF YOU WANT MORE CSS PUT IT HERE YOU FAGGOT ?>
</style>
</head>
<body>
<?php
if(!$loggedin){
echo "
<table><tr><td align='center'>
<table width='320px' height='128px' align='center' style='border: #000 3px double; background: #f0f0f0;'><tr><td>
<form method='post' action='".basename($_SERVER['PHP_SELF'])."' name='login'><table><tr>
<td width='128px'><label for='tuser'>Username: </label></td><td width='256px'><input type='text' name='tuser' value='' size='20'></td></tr><td width='128px'><label for='tpass'>Password: </label></td><td width='256px'><input type='password' name='tpass' value='' size='20' onClick=\"value=''\"></td></tr></table>
<table><tr><td width='180px'><font color='#ff0033' style='font-size:9px;'><b>$error</b></font></td><td width='64px'><input type='submit' name='submit' value='Login'></td></tr></table></form></td></tr>
</table>
";
} else {
?>
All HTML and other stuff goes hereeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
<?
}
?>
</body></html>
I placed all the editable details in blue font and all uneditable in red. Save your code once you've edited the values of the variables - you should have this if you don't want the variable to be used:
$var = "";
Add as many arrays as you want for the random title thing.. that was just a joke anyway..
Save the file as index.php and upload it to your webspace. (yes, funnily enough you need webspace)
Now follow the URL to your index.php and you should see a login screen. Just enter the username and password you defined. You're good to go!
discuss this topic to forum
