Jump to content
MakeWebGames

login.php help plese


Criminal
 Share

Recommended Posts

hi am having problem's this my login i made today the login form is the problem i cant get it to go in the login now box URL is http://criminalbusiness.exofire.net/login.php can any please help me and sort it out and post it back and can some please add the description code so when i put a description on basic settings it bes in the ABOUT THE GAME box and where the buttons are at the top can some one please put links on thank you :-)

login.php

 

<?php
session_start();
include "config.php";
global $_CONFIG;
define("MONO_ON", 1);
require "class/class_db_{$_CONFIG['driver']}.php";
$db=new database;
$db->configure($_CONFIG['hostname'],
$_CONFIG['username'],
$_CONFIG['password'],
$_CONFIG['database'],
$_CONFIG['persistent']);
$db->connect();
$c=$db->connection_id;
$set=array();
$settq=$db->query("SELECT * FROM settings");
while($r=$db->fetch_row($settq))
{
$set[$r['conf_name']]=$r['conf_value'];
}
print <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$set['game_name']}</title>
<script language="JavaScript">
<!--

function getCookieVal (offset) {
 var endstr = document.cookie.indexOf (";", offset);
 if (endstr == -1)
   endstr = document.cookie.length;
 return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
 var arg = name + "=";
 var alen = arg.length;
 var clen = document.cookie.length;
 var i = 0;
 while (i < clen) {
   var j = i + alen;
   if (document.cookie.substring(i, j) == arg)
     return getCookieVal (j);
   i = document.cookie.indexOf(" ", i) + 1;
   if (i == 0) break;
 }
 return null;
}
function SetCookie (name,value,expires,path,domain,secure) {
 document.cookie = name + "=" + escape (value) +
   ((expires) ? "; expires=" + expires.toGMTString() : "") +
   ((path) ? "; path=" + path : "") +
   ((domain) ? "; domain=" + domain : "") +
   ((secure) ? "; secure" : "");
}

function DeleteCookie (name,path,domain) {
 if (GetCookie(name)) {
   document.cookie = name + "=" +
     ((path) ? "; path=" + path : "") +
     ((domain) ? "; domain=" + domain : "") +
     "; expires=Thu, 01-Jan-70 00:00:01 GMT";
 }
}
// -->
</script>

<script language="JavaScript">
var usr;
var pw;
var sv;
function getme()
{
usr = document.login.username;
pw = document.login.password;
sv = document.login.save;

if (GetCookie('player') != null)
{
	usr.value = GetCookie('username')
	pw.value = GetCookie('password')
	if (GetCookie('save') == 'true')
	{
		sv[0].checked = true;
	}
}

}
function saveme()
{
if (usr.value.length != 0 && pw.value.length != 0)
{
	if (sv[0].checked)
	{
		expdate = new Date();
		expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000));
		SetCookie('username', usr.value, expdate);
		SetCookie('password', pw.value, expdate);
		SetCookie('save', 'true', expdate);
	}
	if (sv[1].checked)
	{
		DeleteCookie('username');
		DeleteCookie('password');
		DeleteCookie('save');
	}
}
	else
{
	alert('You must enter a username/password.');
	return false;
}
}
</script>
<style type="text/css">
body { font-family:Tahoma;font-size:9pt;color: white;
  font-variant: small-caps;
  background-color:#222222;
  scrollbar-base-color: #005B70;
  scrollbar-arrow-color: #F3960B;
  scrollbar-DarkShadow-Color: #000000; }
a:visited,a:active,a:hover,a:link { color: white;text-decoration: none; }
A:hover   {cursor: crosshair; color: #0066FF; }
table,tr,td { font-size:9pt; }
img { border:none; }

</style>
</head>
<body>




<center>
EOF;

$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])
   ?  $_SERVER['HTTP_X_FORWARDED_FOR']
   :  $_SERVER['REMOTE_ADDR'];
if(file_exists('ipbans/'.$ip))
{
die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>");
}  
print "<style type='text/css'>
<!--
#Layer6 {
position:absolute;
width:200px;
height:50px;
z-index:2;
left: 363px;
top: 255px;
}
#Layer7 {
position:absolute;
width:200px;
height:115px;
z-index:3;
left: 5px;
top: 265px;
}
#Layer8 {
position:absolute;
width:1081px;
height:33px;
z-index:4;
left: 122px;
top: 800px;
}
#Layer9 {
position:absolute;
width:200px;
height:50px;
z-index:2;
left: 563px;
top: 255px;
}
#Layer10 {
position:absolute;
width:200px;
height:50px;
z-index:2;
left: 763px;
top: 255px;
}
#Layer11 {
position:absolute;
width:200px;
height:50px;
z-index:2;
left: 763px;
top: 255px;
}
body {
   background-color: #000000;
   background-image: url('criminal-business-newlogin1.gif');
   background-repeat: no-repeat;
   background-position: top


}
-->
</style>
<body bgcolor='#444444'>
<div id='Layer7'>




<table width='330' border='0'>


<td><div align='center'><form action=authenticate.php method=post name=login onsubmit=\"return saveme();\"><font color=black>Username: <input type=text name=username>
</div></td>
   <td><div align='center'>     
   </div></td>
 </tr>
 <tr>
   <td><div align='center'><font color=black>Password: <input type=password name=password>
</div></td>
   <td><div align='center'>
   </div></td>
  </tr>
  <tr>
   <td><div align='center'>
<font color=black>Remember me?

<input type=\"radio\" value=\"ON\" name=\"save\"><font color=black>Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked><font color=black>No
<input type=submit value=Submit></form>
</div></td>
   <td><div align='center'>
   </div></td>
 </tr>
 <tr> </tr>
</table>

     </center></td>
   </tr>
 </table>
</div>
<div id='Layer6'>
   <tr>
</div>
<div id='Layer8'>
 <table width='70%' border='0' bgcolor='#000000'>
   <tr>
     <th scope='col'><center>

  </div>   
</center>";
print "</body></html>";
?>
Link to comment
Share on other sites

Re: login.php help plese

Try this bro :) re-coded some nasty HTML ;)

I added the lines from 204-231.

What i added:

<form action=\"authenticate.php\" method=\"post\" name=\"login\" onsubmit=\"return saveme();\">
<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" style=\"color:#000000;font-weight:bold;margin-left:200px;\">
 <tr>
   <td align=\"center\" colspan=\"2\">Login</td>
 </tr>
 <tr>
   <td>Username:</td>
   <td><input type=\"text\" name=\"username\"></td>
 </tr>
 <tr>
   <td>Password:</td>
   <td><input type=\"password\" name=\"password\"></td>
 </tr>
 <tr>
   <td align=\"center\" colspan=\"2\">Remember Me?</td>
 </tr>
 <tr>
   <td align=\"center\" colspan=\"2\">
	<input type=\"radio\" value=\"ON\" name=\"save\"> Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked> No
</td>
 </tr>
 <tr>
   <td align=\"center\" colspan=\"2\"><input type=\"submit\" value=\"Submit\"></td>
 </tr>
</table>
</form>

 

 

New final code after integration (use this, i added the new html already):

 

<?php
session_start();
include "config.php";
global $_CONFIG;
define("MONO_ON", 1);
require "class/class_db_{$_CONFIG['driver']}.php";
$db=new database;
$db->configure($_CONFIG['hostname'],
$_CONFIG['username'],
$_CONFIG['password'],
$_CONFIG['database'],
$_CONFIG['persistent']);
$db->connect();
$c=$db->connection_id;
$set=array();
$settq=$db->query("SELECT * FROM settings");
while($r=$db->fetch_row($settq))
{
$set[$r['conf_name']]=$r['conf_value'];
}
print <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$set['game_name']}</title>
<script language="JavaScript">
<!--

function getCookieVal (offset) {
 var endstr = document.cookie.indexOf (";", offset);
 if (endstr == -1)
   endstr = document.cookie.length;
 return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
 var arg = name + "=";
 var alen = arg.length;
 var clen = document.cookie.length;
 var i = 0;
 while (i < clen) {
   var j = i + alen;
   if (document.cookie.substring(i, j) == arg)
     return getCookieVal (j);
   i = document.cookie.indexOf(" ", i) + 1;
   if (i == 0) break;
 }
 return null;
}
function SetCookie (name,value,expires,path,domain,secure) {
 document.cookie = name + "=" + escape (value) +
   ((expires) ? "; expires=" + expires.toGMTString() : "") +
   ((path) ? "; path=" + path : "") +
   ((domain) ? "; domain=" + domain : "") +
   ((secure) ? "; secure" : "");
}

function DeleteCookie (name,path,domain) {
 if (GetCookie(name)) {
   document.cookie = name + "=" +
     ((path) ? "; path=" + path : "") +
     ((domain) ? "; domain=" + domain : "") +
     "; expires=Thu, 01-Jan-70 00:00:01 GMT";
 }
}
// -->
</script>

<script language="JavaScript">
var usr;
var pw;
var sv;
function getme()
{
usr = document.login.username;
pw = document.login.password;
sv = document.login.save;

if (GetCookie('player') != null)
{
	usr.value = GetCookie('username')
	pw.value = GetCookie('password')
	if (GetCookie('save') == 'true')
	{
		sv[0].checked = true;
	}
}

}
function saveme()
{
if (usr.value.length != 0 && pw.value.length != 0)
{
	if (sv[0].checked)
	{
		expdate = new Date();
		expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000));
		SetCookie('username', usr.value, expdate);
		SetCookie('password', pw.value, expdate);
		SetCookie('save', 'true', expdate);
	}
	if (sv[1].checked)
	{
		DeleteCookie('username');
		DeleteCookie('password');
		DeleteCookie('save');
	}
}
	else
{
	alert('You must enter a username/password.');
	return false;
}
}
</script>
<style type="text/css">
body { font-family:Tahoma;font-size:9pt;color: white;
  font-variant: small-caps;
  background-color:#222222;
  scrollbar-base-color: #005B70;
  scrollbar-arrow-color: #F3960B;
  scrollbar-DarkShadow-Color: #000000; }
a:visited,a:active,a:hover,a:link { color: white;text-decoration: none; }
A:hover   {cursor: crosshair; color: #0066FF; }
table,tr,td { font-size:9pt; }
img { border:none; }

</style>
</head>
<body>




<center>
EOF;

$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])
   ?  $_SERVER['HTTP_X_FORWARDED_FOR']
   :  $_SERVER['REMOTE_ADDR'];
if(file_exists('ipbans/'.$ip))
{
die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>");
}  
print "<style type='text/css'>
<!--
#Layer6 {
position:absolute;
width:200px;
height:50px;
z-index:2;
left: 363px;
top: 255px;
}
#Layer7 {
position:absolute;
width:200px;
height:115px;
z-index:3;
left: 5px;
top: 265px;
}
#Layer8 {
position:absolute;
width:1081px;
height:33px;
z-index:4;
left: 122px;
top: 800px;
}
#Layer9 {
position:absolute;
width:200px;
height:50px;
z-index:2;
left: 563px;
top: 255px;
}
#Layer10 {
position:absolute;
width:200px;
height:50px;
z-index:2;
left: 763px;
top: 255px;
}
#Layer11 {
position:absolute;
width:200px;
height:50px;
z-index:2;
left: 763px;
top: 255px;
}
body {
   background-color: #000000;
   background-image: url('criminal-business-newlogin1.gif');
   background-repeat: no-repeat;
   background-position: top


}
-->
</style>
<body bgcolor='#444444'>
<div id='Layer7'>

<form action=\"authenticate.php\" method=\"post\" name=\"login\" onsubmit=\"return saveme();\">
<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" style=\"color:#000000;font-weight:bold;margin-left:200px;\">
 <tr>
   <td align=\"center\" colspan=\"2\">Login</td>
 </tr>
 <tr>
   <td>Username:</td>
   <td><input type=\"text\" name=\"username\"></td>
 </tr>
 <tr>
   <td>Password:</td>
   <td><input type=\"password\" name=\"password\"></td>
 </tr>
 <tr>
   <td align=\"center\" colspan=\"2\">Remember Me?</td>
 </tr>
 <tr>
   <td align=\"center\" colspan=\"2\">
	<input type=\"radio\" value=\"ON\" name=\"save\"> Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked> No
</td>
 </tr>
 <tr>
   <td align=\"center\" colspan=\"2\"><input type=\"submit\" value=\"Submit\"></td>
 </tr>
</table>
</form>



     </center></td>
   </tr>
 </table>
</div>
<div id='Layer6'>
   <tr>
</div>
<div id='Layer8'>
 <table width='70%' border='0' bgcolor='#000000'>
   <tr>
     <th scope='col'><center>

  </div>   
</center>";
print "</body></html>";
?>
Link to comment
Share on other sites

Re: login.php help plese

Hi,

Yea... I would recommend you slice up the images rather then using one big background. You can play around with the margins i set for the login table and get it in the box, but most likely it will look different to other people with different resolutions and etc...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...