OMGAWD HUGE PROBLEM

im designing website - YES RLY - but I NEED AN LOGIN PANEL


can u PLS
1. explain me how to make
OR
2. give me some site where I can download
[ dutch: kant en klare dus al gemaakt ]
[ english: ready to download, so already made ]
[ polish: konskiguj ? ]
[ french: je m'appelle uxOr` :D ]
[ german: sieg uxOr` [NOT RACIST MENT!!!!]
Comments
14
gl & hf :-()
lol, this post rox !

Anyways, depends if you wanna work with mysql db or not..
The most simple way is just a login script wich protects another page (that page should be your adminpanel written in php.)!

index.php
Quote<?php
session_start();

include ( "./functions.php" );

if ( $_SERVER['REQUEST_METHOD'] == 'POST' )
{

if ( $_POST['sGebruikersNaam'] == "" )
{
echo "Go fill in a damn name, go <a href='javascript:history.back(-1)';>back</a>";
}
elseif ( $_POST['sWachtwoord'] == "" )
{
echo "Go fill in a damn password, go <a href='javascript:history.back(-1)';>back</a>";
}
else
{
if ( !LoginControle() )
{
echo "Loel?!? Nice laming and giving a wrong user or pw :S";
}
else
{
header ( "location: adminpanel_secured.php" );
}

}
}
else
{
?>
<form method="post" action="" >
<table>
<tr>
<td style="width: 100px;">
Username:
</td>
<td>
<input type="text" name="sGebruikersNaam" value="" />
</td>
</tr>
<tr>
<td style="width: 100px;">
Password:
</td>
<td>
<input type="password" name="sWachtwoord" value="" />
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name= submit" value="Gaan" />
</td>
</tr>
</table>
</form>
<?php
}


?>


functions.php
Quote<?php

function LoginControle ()
{
$aGebruikers = array ( array('name','passwOrd'), // Go add some users here!
array('name2','pwz0r')
);
foreach ( $aGebruikers as $value )
{
if ( $_POST['sGebruikersNaam'] == $value[0] && md5 ( $_POST['sWachtwoord'] ) == md5 ( $value[1] ) )
{
$_SESSION['sGebruikersnaam'] = $_POST['sGebruikersNaam'];
$_SESSION['bIngelogd'] = TRUE;
$_SESSION['iTijd'] = time()+300;
$_SESSION['iIp'] = $_SERVER['REMOTE_ADDR'];
return true;
}

}

}


function Beveiliging()
{
if ( isSet ( $_SESSION['bIngelogd'] ) && ( $_SESSION['bIngelogd'] == 1) )
{
if ( $_SESSION['iTijd'] > ( time() ) )
{
$_SESSION['iTijd'] = time()+300;
return true;
}
elseif ( $_SERVER['REMOTE_ADDR'] != $_SESSION['iIp'] )
{
return false;
}
else
{
return false;
}
}

}


And now lets redirect it to your uberpr0 adminpanel!

Here is the script to protect your adminpanel:
Quote<?php
session_start();
include ( "functions.php" );

if ( !Beveiliging() )
{
echo "You are not logged in XD L0ser?!";
}
else
{
if ( !isSet ( $_GET['actie'] ) )
{
echo "The rest if the page is here:<br /><br />";
echo '<a href="adminpanel_secured2.php">Next page</a><br />';
echo '<a href="adminpanel_secured.php?actie=uitloggen">Logout</a>';
}
else
{
switch ( $_GET['actie'] )
{
case 'uitloggen':
session_start();
session_destroy();
header ( "location: index.php" );
}
}

}

?>


Have fun!
omg c++ haxor omg omg
Parent
learn some php npz
ZE PERFORATOR UNBANNED OMG CONGARTS
Thanks INSECURE
Parent
ik ben niet insecure :<
Parent
Back to top