Announcement

Collapse
No announcement yet.

login.php help

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • login.php help

    here is my login.php
    Code:
    <?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 {
    background-color: #000000;
    margin-top: 0px;
    margin-bottom: 0px;
    font-family:calibri, helvetica, arial, geneva, sans-serif;font-size:12px;color: yellow;
       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; }
    table,tr,td { font-family:helvetica, arial, geneva, sans-serif;font-size: 12px; }
    img { border:none; }
    textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: white; }
    .table2 {
    }
    .lgrad {
    background-image:url(lgrad.jpg);
    background-repeat:repeat-y;
    width:19px;
    }
    .linegrad {
    background-image:url(linegrad.PNG);
    background-repeat:repeat-y;
    background-align: center;
    width:2px;
    }
    .rgrad {
    background-image:url(rgrad.jpg);
    background-repeat:repeat-y;
    width:19px;
    }
    .dgrad {
    background-image:url(dgrad.jpg);
    background-repeat:repeat-x;
    height:38px;
    }
    .dgradl {
    background-image:url(dgradl.jpg);
    background-repeat:no-repeat;
    height:38px;
    width:38px;
    }
    .dgradr {
    background-image:url(dgradr.jpg);
    background-repeat:no-repeat;
    height:38px;
    width:38px;
    }
    .center {
    width:932px;
    background-color:#000000;
    vertical-align:top;
    text-align:center;
    }
    .table {
    background-color:#000000;
    }
    .table3 {
    background-color:#000000;
    }
    .table td {
    background-color:#000000;
    height:22px;
    }
    .table3 td {
    background-color:#000000;
    }
    td .alt {
    background-color:#000000;
    height:22px;
    }
    td .h {
    background-image:url(tablehgrad.png);
    background-repeat:repeat-x;
    font-weight: bold;
    background-color: #000000;
    }
    .table th {
    background-image:url(tablehgrad.png);
    background-repeat:repeat-x;
    font-weight: bold;
    background-color: #000000;
    }
    -->
    </style></head>
    <body onload="getme();">
    <center>
    <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2">
    <tr>
    <td class="lgrad"></td>
    <td class="center">
    
    
    EOF;
    $IP = ($_SERVER['HTTP_X_FORWARDED_FOR'])
        ?  $_SERVER['HTTP_X_FORWARDED_FOR']
        :  $_SERVER['REMOTE_ADDR'];
    if(file_exists('ipbans/'.$IP))
    {
    die("<font color=red size=+1>Your IP has been banned, there is no way around this.</font></body></html>");
    }
    $year=date('Y');
    print "<h3>{$set['game_name']} Logging page</h3>
    
    <div id='Layer8'>
      <table width='181' height='203' border='1' bgcolor='#333333'>
        <tr>
          <th height='50' scope='col'>Navigation</th>
        </tr>
        <tr>
          <td height='30'>Login</td>
        </tr>
        <tr>
          <td height='28'>Register</td>
        </tr>
        <tr>
          <td height='30'>Lost Password?</td>
        </tr>
        <tr>
          <td height='30'>Screenshots</td>
        </tr>
        <tr>
          <td height='30'>Terms Of Service</td>
     
    </div><center><font color=white>
    
    
    <table width='50%' border='3' cellpadding='1' cellspacing='1'>
    <tr>
    <td width='20%'  bgcolor='#000000' valign='top'><big>Register</big> | <big>Forum</big></p>
    
    <center>
    <table width=100% border=6 cellspacing=0 class=tabletrans><th><font color=white>Decription</th><th><font color=white>Login</th><tr><td width=50%><center><font color=white>
    To be written
    
    </td><td><form action=authenticate.php method=post name=login onsubmit=\"return saveme();\">Username: <input type=text name=username>
    
    Password: <input type=password name=password>
    
    Remember me?
    
    <input type=\"radio\" value=\"ON\" name=\"save\">Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked>No
    <input type=submit value=Submit></a></form></td></tr></table></center>
    
    
    
    
    <font color=white> <center><table width=30% border=1 cellspacing=0 class=tabletrans><th><font color=white>
    <center>
    Powered by codes made by Dabomstew (&copy {$year}). Game Copyright {$year} {$set['game_owner']}.</center>";
    print <<<OUT
    </td>
    <td class="rgrad"></td>
    </tr>
    <tr>
    <td colspan="3">
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
    <td class="dgradl"> </td>
    </center></td>
        </tr>
      </table>
    
    
    
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </body>
    </html>
    OUT;
    ?>
    my probrlem is here
    Code:
    <div id='Layer8'>
      <table width='181' height='203' border='1' bgcolor='#333333'>
        <tr>
          <th height='50' scope='col'>Navigation</th>
        </tr>
        <tr>
          <td height='30'>Login</td>
        </tr>
        <tr>
          <td height='28'>Register</td>
        </tr>
        <tr>
          <td height='30'>Lost Password?</td>
        </tr>
        <tr>
          <td height='30'>Screenshots</td>
        </tr>
        <tr>
          <td height='30'>Terms Of Service</td>
    i want to put that where the white thing is next to the login part but with a little space in between
    you can see it as www.hitman-country.novahost.org
    i know it is on a free host that why im buying a host and domain soon.

  • #2
    Re: login.php help

    Is this better now

    Code:
    <?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 {
    background-color: #000000;
    margin-top: 0px;
    margin-bottom: 0px;
    font-family:calibri, helvetica, arial, geneva, sans-serif;font-size:12px;color: yellow;
       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; }
    table,tr,td { font-family:helvetica, arial, geneva, sans-serif;font-size: 12px; }
    img { border:none; }
    textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: white; }
    .table2 {
    }
    .linegrad {
    background-image:url(linegrad.PNG);
    background-repeat:repeat-y;
    background-align: center;
    width:2px;
    }
    .rgrad {
    background-image:url(rgrad.jpg);
    background-repeat:repeat-y;
    width:19px;
    }
    .dgrad {
    background-image:url(dgrad.jpg);
    background-repeat:repeat-x;
    height:38px;
    }
    .dgradl {
    background-image:url(dgradl.jpg);
    background-repeat:no-repeat;
    height:38px;
    width:38px;
    }
    .dgradr {
    background-image:url(dgradr.jpg);
    background-repeat:no-repeat;
    height:38px;
    width:38px;
    }
    .center {
    width:932px;
    background-color:#000000;
    vertical-align:top;
    text-align:center;
    }
    .table {
    background-color:#000000;
    }
    .table3 {
    background-color:#000000;
    }
    .table td {
    background-color:#000000;
    height:22px;
    }
    .table3 td {
    background-color:#000000;
    }
    td .alt {
    background-color:#000000;
    height:22px;
    }
    td .h {
    background-image:url(tablehgrad.png);
    background-repeat:repeat-x;
    font-weight: bold;
    background-color: #000000;
    }
    .table th {
    background-image:url(tablehgrad.png);
    background-repeat:repeat-x;
    font-weight: bold;
    background-color: #000000;
    }
    -->
    </style></head>
    <body onload="getme();">
    <center>
    <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2">
    <tr>
    <td class="lgrad"></td>
    <td class="center">
    
    
    EOF;
    $IP = ($_SERVER['HTTP_X_FORWARDED_FOR'])
        ?  $_SERVER['HTTP_X_FORWARDED_FOR']
        :  $_SERVER['REMOTE_ADDR'];
    if(file_exists('ipbans/'.$IP))
    {
    die("<font color=red size=+1>Your IP has been banned, there is no way around this.</font></body></html>");
    }
    $year=date('Y');
    print "<h3>{$set['game_name']} Login Now</h3>
    
    <table width='100%' border='3' cellpadding='1' cellspacing='1'>
    <tr>
    <td width='20%'  bgcolor='#000000' valign='top'><big>Register</big> | <big>Forum</big></p> | <big>Login now</big>
    
    <center>
    <table width=100% border=6 cellspacing=0 class=tabletrans><th><font color=white>Decription</th><th><font color=white>Login</th><tr><td width=50%><center><font color=white>
    To be written
    
    </td><td><form action=authenticate.php method=post name=login onsubmit=\"return saveme();\">Username: <input type=text name=username>
    
    Password: <input type=password name=password>
    
    Remember me?
    
    <input type=\"radio\" value=\"ON\" name=\"save\">Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked>No
    <input type=submit value=Submit></a></form></td></tr></table></center>
    
    
    
    
    <font color=white> <center><table width=30% border=1 cellspacing=0 class=tabletrans><th><font color=white>
    
    <td></td>
    <hr><h1>Register now</h1>
    <hr><center>Powered by codes made by Dabomstew (&copy {$year}). Game Copyright {$year} {$set['game_owner']}.</tr></center>";
    
    print <<<OUT
    </td>
    </tr>
    <tr>
    <td colspan="3">
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
    </center></td>
        </tr>
      </table>
    
    
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </body>
    </html>
    OUT;
    ?>

    Comment


    • #3
      Re: login.php help

      thanks very much yes that is much better

      Comment

      Working...
      X