- Joined
- Jul 16, 2008
- Messages
- 861
- Reaction score
- 25
Hi, i created my own Login system for my site
Here is script.
login.php
checklogin.php
Page.php
config.php
site:
http://nlgunz.sytes.net/nlgunz/wut/index.php?page=Login
You can Login with
Username = ragezone
Password = ragezone1
The problem, if i click on a <a href=""></a> in the menu. It gonna automatic back to the error Message.
And it won't include the things i asked for -,- i dunno how to make my login now fully work -,-
Any more information ask.
Here is script.
login.php
PHP:
<?
/**
* @author hylperzone
* @copyright 2009
*/
?>
<td rowspan="4" background="http://forum.ragezone.com/images/wut_12.png" width="446" height="354" id="nieuws"><center><form action="php/checklogin.php" method="post">
Gebruikersnaam:<input type="text" name="username" /><br />
Wachtwoord:<input type="password" name="password" /><br />
<input type="submit" name="login" value="Login" />
</form><div><a href="?page=Registreer">Nog geen Account klik hier om u te registreren!</a></div></center>
</td>
checklogin.php
PHP:
<?php
/**
* @author hylperzone
* @copyright 2009
*/
?>
<style type="text/css">
body{
background-color: #211F1F;
color:white;
}
#tablel{
border:2px solid black;
background-color: #400000;
}
A:link{
color: silver;
}
A:hover{
color:red;
}
A:Visited{
color:silver;
}
A:active{
color:red;
}
#ing{
border:2px solid black;
background-color: #400000;
}
</style>
<?
include('config.php');
$user = antisql($_POST['username']);
$pw = antisql($_POST['password']);
$query = mssql_query("SELECT * FROM login Where UserID='$user' AND password='$pw'");
$check = mssql_num_rows($query);
$ban = mssql_query("SELECT * FROM Account Where UserID='$user'");
$checkban = mssql_fetch_assoc($ban);
$grade = $checkban['UGradeID'];
if(!$check){
fuckoff();
}
elseif($grade == 253){
ban();
}elseif($check == true){
?>
<table align="center" id="ing" width="800" border="1">
<tr><td>
Welkom <b><?=$user;?></b>
</td><td><?
if(!$_GET['page']){
echo 'Home';
}else{
echo $_GET['page'];
}
?></td>
</tr>
<tr>
<td>
<a href="?page=Home">Home</a><br />
<a href="?page=changepw">Verander wachtwoord</a><br />
<a href="?page=deleteclan">Clan Verwijderen</a><br />
<a href="?page=maakclan">Clan Aanmaken</a>
</td><td><? include('cpanel\page.php'); ?></td>
</tr>
</table>
<?
}
?>
PHP:
<?php
/**
* @author hylperzone
* @copyright 2009
*/
if($_GET['page']==''){
include('cpanel/home.php');
}elseif($_GET['page']==Home){
include('cpanel/home.php');
}elseif($_GET['page']==changepw){
include('cpanel/changepw.php');
}elseif($_GET['page']==maakclan){
include('cpanel/mc.php');
}elseif($_GET['page']==deleteclan){
include('cpanel/dc.php');
}
?>
PHP:
<?php
/**
* @author hylperzone
* @copyright 2009
*/
//Servers.
$myhost = '';
$odhost = '';
$mshost = '';
//Pw's.
$mypw = '';
$odpw = '';
$mspw = '';
//Inlogames.
$myname = '';
$odname = '';
$msname = '';
//ODBC database.
$oddb = 'GunzDB';
//Connection Strings.
$conms = mssql_connect($mshost,$msname,$mspw);
$conod = odbc_connect($oddb,$odname,$odpw);
$conmy = mysql_connect($myhost,$myname,$mypw);
//database connections.
$mydb = mysql_select_db('hylperzone',$conmy);
$msdb = mssql_select_db('GunzDB',$conms);
if(!$conms){
echo 'Een fout in de verbinding(MSSQL).';
}
if(!$conmy){
echo 'Een fout in de verbinding(MySQL).';
}
if(!$conod){
echo 'Een fout in de verbinding(ODBC).';
}
function antisql($sql) {
$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|--|\\\\)/"),"",$sql);
$sql = trim($sql);
$sql = strip_tags($sql);
$sql = addslashes($sql);
return $sql;
}
function gtfo($wut) {
echo "<div id='bg'><center><table width='' height='300'>
<tr>
<td align=center width='100%'><b><font color=\"#000000\">Bericht:</b></td>
</tr>
<tr>
<td width='100%'><center><font color=\"#000000\"><b>$wut</center></td>
</tr>
</table></div>";
die();
}
function checkemail($address) {
list($local, $host) = explode("@", $address);
$pattern_local = "^([0-9a-z]*([-|_]?[0-9a-z]+)*)(([-|_]?)\.([-|_]?)[0-9a-z]*([-|_]?[0-9a-z]+)+)*([-|_]?)$";
$pattern_host = "^([0-9a-z]+([-]?[0-9a-z]+)*)(([-]?)\.([-]?)[0-9a-z]*([-]?[0-9a-z]+)+)*\.[a-z]{2,4}$";
$match_local = eregi($pattern_local, $local);
$match_host = eregi($pattern_host, $host);
if($match_local && $match_host) {
return 1;
}
else {
return 0;
}
}
function num_rows(&$rid) {
$num= odbc_num_rows($rid);
if ($num >= 0) {
return $num;
}
if (!odbc_fetch_row($rid, 1)) {
odbc_fetch_row($rid, 0);
return 0;
}
if (!odbc_fetch_row($rid, 2)) {
odbc_fetch_row($rid, 0);
return 1;
}
$lo= 2;
$hi= 8192000;
while ($lo < ($hi - 1)) {
$mid= (int)(($hi + $lo) / 2);
if (odbc_fetch_row($rid, $mid)) {
$lo= $mid;
} else {
$hi= $mid;
}
}
$num= $lo;
odbc_fetch_row($rid, 0);
return $num;
}
function fuckoff(){
echo "<center><table id='tablel'><tr><td><p align='center'>Login:</p</td></tr<tr><td><font color='red'>Verkeerde Gebruikersnaam / Wachtwoord!</font></td></tr><tr><td><p align='center>'><a href='../index.php?page=Login'>Klik hier om opnieuw in te loggen.</a></p></td></tr></table></center>";
}
function ban(){
echo "<center><table id='tablel'><tr><td><p align='center'>Login:</p</td></tr<tr><td><font color='red'>U bent gebanned op NLGunZ u bent hier niet meer welkom!!</font></td></tr><tr><td><p align='center>'><a href='../index.php?page=Login'>Klik hier om opnieuw in te loggen.</a></p></td></tr></table></center>";
}
?>
http://nlgunz.sytes.net/nlgunz/wut/index.php?page=Login
You can Login with
Username = ragezone
Password = ragezone1
The problem, if i click on a <a href=""></a> in the menu. It gonna automatic back to the error Message.
And it won't include the things i asked for -,- i dunno how to make my login now fully work -,-
Any more information ask.

