Jump to content
MakeWebGames

Need help with my index.php


kaine-

Recommended Posts

<?php
session_start();
include 'includes/db_connect.php';
include 'register.php';
include 'pwremind.php';

function GetUserIP() {

   if (isset($_SERVER)) {

       if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
           return $_SERVER["HTTP_X_FORWARDED_FOR"];

       if (isset($_SERVER["HTTP_CLIENT_IP"]))
           return $_SERVER["HTTP_CLIENT_IP"];

       return $_SERVER["REMOTE_ADDR"];
   }

   if (getenv('HTTP_X_FORWARDED_FOR'))
       return getenv('HTTP_X_FORWARDED_FOR');

   if (getenv('HTTP_CLIENT_IP'))
       return getenv('HTTP_CLIENT_IP');

   return getenv('REMOTE_ADDR');
}


$realip = GetUserIP();

function lookupIp() {
$realip = GetUserIP();
include("geoip.inc");
$handle = geoip_open("GeoIP.dat", GEOIP_STANDARD);
$co = geoip_country_name_by_addr($handle, "$realip");
return $co;
}

if ($_POST['login']){

if(!$_POST['username']){
		$message="Please enter a valid username!";
}elseif(!$_POST['password']){
		$message="Please enter a valid password";
}else{

                $username=mysql_real_escape_string(strip_tags($_POST['username']));
                $password=mysql_real_escape_string(strip_tags($_POST['password']));

	$sql = mysql_query("SELECT SQL_NO_CACHE id FROM users WHERE username='$username' AND password='$password' AND activated='1'");
	$login_check = mysql_num_rows($sql);
	$targetstats = mysql_query("SELECT SQL_NO_CACHE username, password, status FROM users WHERE username='$username'");
	while($ts = mysql_fetch_array($targetstats)){
		$username= $ts[0];
		$pw = $ts[1];
		$status = $ts[2];
	}
	if($pw!=$password){
		$message="Invalid username and password combination";
	}elseif($login_check == 0 ){
		$message="Invalid username and password combination";
	}elseif($pw!=$password){
		$message="Invalid username and password combination";
	}elseif ($status == "Dead"){
							echo "<SCRIPT LANGUAGE='JavaScript'>window.location='Dead.aspx';</script>";
	}elseif ($status == "Banned"){
				echo "<SCRIPT LANGUAGE='JavaScript'>window.location='Banned.aspx?busername=$username';</script>";
		exit();
	}else{
			$_SESSION['username'] = $username;
			$_SESSION['password'] = $password;
			$now = time();
			$domain = $_SERVER['REMOTE_ADDR'];
			mysql_query("UPDATE users SET r_ip='$domain' WHERE username='$username'");
                               $co = lookupIp();
			mysql_query("UPDATE users SET realcount='$co' WHERE username='$username'");
			echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=Auth.aspx\">";
		}
	}
}
if(session_is_registered('username')){		
$checkpassword = $_SESSION['password'];
$checkusername = $_SESSION['username'];
$checklogin = mysql_query("SELECT SQL_NO_CACHE id FROM users WHERE username='$checkusername' AND password='$checkpassword'");
$checkloginrows = mysql_num_rows($checklogin);
if($checkloginrows > 0 ){
	echo "<SCRIPT LANGUAGE='JavaScript'>window.location='Auth.aspx';</script>";
	exit();
}else{
	unset($_SESSION['username'],$_SESSION['password']);
}
}
$timenow=time();
$select = mysql_query("SELECT SQL_NO_CACHE * FROM users WHERE online > '$timenow' ORDER by username");
$num = mysql_num_rows($select);
?>
<html>
<html><title>Mafia Elite</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="includes/in.css" rel="stylesheet" type="text/css">
</head>
 <form name="form2" method="post" action="">

   <table  width="632" height="759" border="0" cellpadding="0" cellspacing="0" align="center">
<td colspan="15" width="503" height="72" style="background: url(index_img/index_01.gif);" valign="top"><? echo"<font color=\"white\">$message</font>"; ?></td>
     <td colspan="7" rowspan="2"><img src="index_img/index_02.gif" width="128" height="77" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="72" border="0px"></td>
     </tr>
     <tr>
       <td><img src="index_img/index_03.gif" width="44" height="5" border="0px"></td>
       <td colspan="6" rowspan="4"><input name="username" type="text" id="username" style="background: url(index_img/lu.gif);  width:220; height:33;color:#ffffff;padding-left:5px;font-size:13px;text-decoration:none;border:0px;"></td>
       <td colspan="2" rowspan="5"><img src="index_img/index_05.gif" width="19" height="206" border="0px"></td>
       <td colspan="6" rowspan="3"><input name="password" type="password" id="password" style="background: url(index_img/lp.gif);  width:220; height:32;border:0px;color:#ffffff;padding-left:5px;font-size:13px;text-decoration:none;"></td>
       </td>
       <td><img src="index_img/spacer.gif" width="1" height="5" border="0px"></td>
     </tr>
     <tr>
       <td rowspan="3"><img src="index_img/index_07.gif" width="44" height="28" border="0px"></td>
       <td rowspan="3"><img src="index_img/index_08.gif" width="13" height="28" border="0px"></td>
       <td colspan="4"><input name="login" type="submit"   id="login" style="background: url(index_img/lb.gif);  width:66px; height:25px;border:0px;" value=" "></td>
       <td colspan="2" rowspan="3"><img src="index_img/index_10.gif" width="49" height="28" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="25" border="0px"></td>
     </tr>
     <tr>
       <td colspan="4" rowspan="2"><img src="index_img/index_11.gif" width="66" height="3" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="2" border="0px"></td>
     </tr>
     <tr>
       <td colspan="6"><img src="index_img/index_12.gif" width="220" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="1" border="0px"></td>
     </tr>
     <tr>
       <td colspan="3" rowspan="14"><img src="index_img/index_13.gif" width="171" height="559" border="0px"></td>
       <td colspan="4"><img src="index_img/index_14.gif" width="93" height="173" border="0px"></td>
       <td colspan="5"><img src="index_img/index_15.gif" width="185" height="173" border="0px"></td>
       <td colspan="8" rowspan="13"><img src="index_img/index_16.gif" width="163" height="557" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="173" border="0px"></td>
     </tr>
     <tr>
       <td colspan="11"  width="297" height="45" style="background: url(index_img/em.gif);border:0px;"><? echo"$message2"; ?></td>
       <td><img src="index_img/spacer.gif" width="1" height="45" border="0px"></td>
     </tr>
     <tr>
       <td colspan="11"><img src="index_img/index_18.gif" width="297" height="39" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="39" border="0px"></td>
     </tr>
     <tr>
       <td rowspan="8"><img src="index_img/index_19.gif" width="42" height="224" border="0px"></td>
       <td colspan="9"><input name="reg_username" type="text" id="reg_username" style="background: url(index_img/du.gif);  width:220px; height:31px;border:0px;color:#333333;padding-left:5px;font-size:13px;">
       </td>
       <td rowspan="13"><img src="index_img/index_21.gif" width="35" height="304" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="31" border="0px"></td>
     </tr>
     <tr>
       <td colspan="9"><img src="index_img/index_22.gif" width="220" height="28" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="28" border="0px"></td>
     </tr>
     <tr>
       <td colspan="9"><input name="reg_password" type="text" id="reg_password" style="background: url(index_img/rp.gif);  width:220px; height:31px;border:0px;color:#333333;padding-left:5px;font-size:13px;"></td>
       <td><img src="index_img/spacer.gif" width="1" height="31" border="0px"></td>
     </tr>
     <tr>
       <td colspan="9"><img src="index_img/index_24.gif" width="220" height="30" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="30" border="0px"></td>
     </tr>
     <tr>
       <td colspan="9"><input name="email" type="text" id="email" style="background: url(index_img/re.gif);  width:220px; height:31px;border:0px;color:#333333;padding-left:5px;font-size:13px;"></td>
       <td><img src="index_img/spacer.gif" width="1" height="31" border="0px"></td>
     </tr>
     <tr>
       <td colspan="9"><img src="index_img/index_26.gif" width="220" height="21" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="21" border="0px"></td>
     </tr>
     <tr>
       <td rowspan="2"><img src="index_img/index_27.gif" width="29" height="52" border="0px"></td>
       <td colspan="7"><input name="register" type="submit"   id="register" style="background: url(index_img/reb.gif);  width:167px; height:30px;border:0px;color:#ffffff;padding-left:5px;font-size:13px;" value=" "></td>
       <td rowspan="7"><img src="index_img/index_29.gif" width="24" height="132" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="30" border="0px"></td>
     </tr>
     <tr>
       <td colspan="7"><img src="index_img/index_30.gif" width="167" height="22" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="22" border="0px"></td>
     </tr>
     <tr>
       <td colspan="3"><img src="index_img/index_31.gif" width="81" height="21" border="0px"></td>
       <td colspan="6" rowspan="4"><img src="index_img/index_32.gif" width="157" height="79" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="21" border="0px"></td>
     </tr>
     <tr>
       <td colspan="3" rowspan="3"><img src="index_img/index_33.gif" width="81" height="58" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="55" border="0px"></td>
     </tr>
     <tr>
       <td colspan="8"><img src="index_img/index_34.gif" width="163" height="2" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="2" border="0px"></td>
     </tr>
     <tr>
       <td colspan="3"><img src="index_img/index_35.gif" width="171" height="1" border="0px"></td>
       <td colspan="4" rowspan="2"><img src="index_img/index_36.gif" width="50" height="2" border="0px"></td>
       <td colspan="4" rowspan="3"><img src="index_img/index_37.gif" width="113" height="5" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="1" border="0px"></td>
     </tr>
     <tr>
       <td colspan="2" rowspan="6"><img src="index_img/index_38.gif" width="45" height="93" border="0px"></td>
       <td colspan="6" rowspan="2"><img src="index_img/lou.gif" width="220" height="4" border="0px"></td>
       <td colspan="4"><img src="index_img/index_40.gif" width="144" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="1" border="0px"></td>
     </tr>
     <tr>
       <td colspan="3"><img src="index_img/index_41.gif" width="33" height="3" border="0px"></td>
       <td colspan="6" rowspan="4"><input name="lemail" type="text" id="lemail" style="background: url(index_img/loe.gif);  width:219px; height:32px;border:0px;color:#ffffff;padding-left:5px;font-size:13px;"></td>
       <td rowspan="5"><img src="index_img/index_43.gif" width="1" height="92" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="3" border="0px"></td>
     </tr>
     <tr>
       <td colspan="5" rowspan="2"><input name="user" type="text" id="user" style="background: url(index_img/lou-45.gif);  width:219px; height:28px;border:0px;color:#ffffff;padding-left:5px;font-size:13px;"></td>
       <td colspan="3" rowspan="4"><img src="index_img/index_45.gif" width="33" height="89" border="0px"></td>
       <td rowspan="4"><img src="index_img/index_46.gif" width="1" height="89" border="0px"></td>
       <td rowspan="4"><img src="index_img/index_47.gif" width="15" height="89" border="0px"></td>
       <td colspan="2"><input name="lp" type="submit"   id="lp" style="background: url(index_img/rem.gif);  width:65px; height:25px;border:0px;color:#ffffff;padding-left:5px;font-size:13px;" value=" "></td>
       <td rowspan="4"><img src="index_img/index_49.gif" width="33" height="89" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="25" border="0px"></td>
     </tr>
     <tr>
       <td colspan="2" rowspan="3"><img src="index_img/index_50.gif" width="65" height="64" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="3" border="0px"></td>
     </tr>
     <tr>
       <td colspan="5" rowspan="2"><img src="index_img/index_51.gif" width="219" height="61" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="1" border="0px"></td>
     </tr>
     <tr>
       <td colspan="6" width="219" height="60" style="background: url(index_img/index_52.gif);"><? echo"<font color=\"white\">$message3</font>"; ?></td>
       <td><img src="index_img/spacer.gif" width="1" height="60" border="0px"></td>
     </tr>
     <tr>
       <td><img src="index_img/spacer.gif" width="44" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="126" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="42" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="29" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="10" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="12" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="18" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="14" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="111" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="24" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="35" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="35" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="13" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="1" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="15" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="49" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="16" height="1" border="0px"></td>
       <td><img src="index_img/spacer.gif" width="33" height="1" border="0px"></td>
       <td></td>
     </tr>
   </table>
   <p align="center">*  Site is best viewed in firefox *</p>
</form>

 

I need it so the bit where it says login and the user and password is on the left hand side and the register and so on is smaller and the image/s from behind register and everything gone and so its edited so i can add just one big image. Please help me.

Edited by Nickson
added bbcode
Link to comment
Share on other sites

  • 3 weeks later...

Ok i have an answer, seriously listen.

look at the code of that page one line at a time, and logically in your mind figure out what each line is doing. If you are not familiar with atleast html and php.

You might find yourself in a pitfall in the medium-run where you can never release updates or modifications :/

Keep at it!. :)

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.

×
×
  • Create New...