Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

need some serious help with this PHP

Status
Not open for further replies.
Initiate Mage
Joined
Jul 25, 2020
Messages
4
Reaction score
0
For 2 days I've been struggling getting this website to show and it seems to have TONS of errors, tons of problems and it's mostly the front page that I'm struggling to display correctly. (Yes this is the AreaGunz website which supposedly was supposed to work but does nothing but show errors and the layout constantly breaks).
PHP:
<?php        // ********************************************************************************************* //        // ******************* Website Created/Proggramed/Encoded By David (ConSext) ******************* //        // *********************************** Design By Ofir ****************************************** //        // * Thanks For David Keigler For Helping With The Encode And For Dor (Rexo) For Adding Stuff ** //        // ********************************************************************************************* //        session_start();        // -------- Includes -------- //        require "include/Config.php";        require "include/ASQL.php";        $today = date('n/j/Y');        // ---------- End ---------- //?><!DOCTYPE html><html lang="he"><head>    <title>Israel Gunz | Website</title>    <LINK REL="SHORTCUT ICON" HREF="http://forum.ragezone.com/images/IsraelGunz.ico" />    <meta charset="utf-8" />    <META NAME="keywords" content="keywords,keywords,googlekeywords">    <META NAME="Description" CONTENT="AreaGunZ / Website !">    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/>    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script></head><div id="wrapper"><body>    <header>        <div id='Serverstatus'>            <?                $serverstatuschecksocket =  [USER=493081]fsockopen[/USER]("IsraelGunz.info", 6000, $errno, $errstr,0);                if($serverstatuschecksocket) {                    echo "<span style='color:green;'>Online</sp an>";                }                else {                    echo "<span style='color:red;'>Offline</span>";                }            ?>        </div>        <nav id="navbar">            <a href='index.php?page=Main'><img src="http://forum.ragezone.com/images/home_off.png" onmouseover="this.src='images/home_on.png'" onmouseout="this.src='images/home_off.png'"/></a>            <a href='index.php?page=Register'><img src="http://forum.ragezone.com/images/register_off.png" onmouseover="this.src='images/register_on.png'" onmouseout="this.src='images/register_off.png'"/></a>            <a href='index.php?page=Download'><img src="http://forum.ragezone.com/images/downloads_off.png" onmouseover="this.src='images/download_on.png'" onmouseout="this.src='images/downloads_off.png'"/></a>            <a href='index.php?page=Userpanel'><img src="http://forum.ragezone.com/images/manage_off.png" onmouseover="this.src='images/manage_on.png'" onmouseout="this.src='images/manage_off.png'"/></a>            <a href='index.php?page=Itemshop&type=1&shop=0'><img src="http://forum.ragezone.com/images/itemshop_off.png" onmouseover="this.src='images/itemshop_on.png'" onmouseout="this.src='images/itemshop_off.png'"/></a>            <a href='index.php?page=Ranking&type=0'><img src="http://forum.ragezone.com/images/ranking_off.png" onmouseover="this.src='images/ranking_on.png'" onmouseout="this.src='images/ranking_off.png'"/></a>        </nav>        <div id='PlayersOnline'>            <?                $checkplayersonlinequery = mssql_query("SELECT CurrPlayer FROM ServerStatus WHERE ServerID=1");                $checkplayergetrow = mssql_fetch_row($checkplayersonlinequery);                echo "<span name='player'>" . $checkplayergetrow[0] . "</span>";            ?>        </div>        <div id='MyAccount'>        <?        echo "<form method='post'>";            $user = $_SESSION['username'];            if(isset($_SESSION['logged'])) {                echo "<span>Hello $user !</span> <input type='image' src='images/logout.png' name='logout' id='Logout' /> <input type='image' src='images/userpanel.png' name='userpanel' id='Userpanel' />";                    if(isset($_POST['userpanel_x'])) {                    redirect("index.php?page=Userpanel",0);                    die();                }                if(isset($_POST['logout_x'])) {                    redirect("index.php?page=Logout",0);                    die();                }                echo "</form>";            }            else {        ?>            <form method='post'>            <input type='text' name='username' id="username" />            <input type='password' name='password' id='password'/>            <input type='image' src='images/login_button.png' name='login' id="loginb" />                <input type='image' src='images/register_button.png' name='register' id="registerb" />            <?php            }                if(isset($_POST['register_x'])) {                    redirect("index.php?page=Register",0);                    die();                }                if(isset($_POST['login_x'])) {                    $username = CleanIt($_POST['username']);                    $password = CleanIt($_POST['password']);                    $checkuserexist = mssql_query("SELECT * FROM Login WHERE UserID='$username' AND Password='$password'");                    if($checkuser = mssql_num_rows($checkuserexist) == 1) {                        $getcoins_luckysquery = mssql_query("SELECT Coins,eCoins,LuckyBoxes FROM Account WHERE UserID='$username'");                        $getcoins_luckys = mssql_fetch_row($getcoins_luckysquery);                        $_SESSION['username'] = $username;                        $_SESSION['password'] =    $password;                        $_SESSION['dcoins'] = $getcoins_luckys[0];                        $_SESSION['ecoins'] = $getcoins_luckys[1];                        $_SESSION['LuckyBoxes'] = $getcoins_luckys[2];                        $_SESSION['logged'] = rand();                        redirect("index.php",0);                        die();                    }                    else {                        Alert("Username or password not good ! ");                        redirect("index.php",0);                        die();                    }                }            ?>            </form>        </div>        <div id='Announc'>            <?                if(CheckWeekendEvent() == 1) {                    echo "<span><marquee behavior='scroll' direction='left'><a href='index.php?page=WeekendEvent' style='color:lightgreen;'>IsraelGunz.co.il - The Weekend Event is open ! Go take your prize.</a></marquee></span>";                }                else {                    echo "<span><marquee behavior='scroll' direction='left'>" . GetData(ServerStatus,Shout,ServerID,1) . "</marquee></span>";                }            ?>        </div>    </header>    <article>        <div id='ServerStatistics'>            <?                $statisticaccountsquery = mssql_query("SELECT * FROM Account");                $statisticcharactersquery = mssql_query("SELECT * FROM Character");                $statisticclansquery = mssql_query("SELECT * FROM Clan");                $statisticactiveacc = mssql_query("SELECT * FROM Login WHERE LastConnDate!=NULL");                $statisticmostonline = mssql_query("SELECT TOP 1 PlayerCount FROM ServerLog ORDER BY PlayerCount DESC");                $bestplayerquery = mssql_query("SELECT TOP 1 Name,KillCount,DeathCount FROM Character WHERE Level > 29 ORDER BY KillCount / DeathCount DESC");                $accountrows = mssql_num_rows($statisticaccountsquery);                $charactersrows = mssql_num_rows($statisticcharactersquery);                $clansrows = mssql_num_rows($statisticclansquery);                $activeaccounts = mssql_num_rows($statisticactiveacc);                $recordonline = mssql_fetch_row($statisticmostonline);                $bestplayer = mssql_fetch_row($bestplayerquery);                echo "<br><br><br><span>Accounts Created :</span><span style='float:right;'> $accountrows</span>";                echo "<span>Characters :</span><span style='float:right;'> $charactersrows </span>";                echo "<span>Clans Created :</span><span style='float:right;'> $clansrows </span>";                echo "<span>Activity Accounts :</span><span style='float:right;'> $activeaccounts </span>";                echo "<span>Record Onlines :</span><span style='float:right;'> $recordonline[0] </span>";                echo "<span>Our Best Player :</span><span style='float:right;margin-top:-16px;><a style='color:#a1a1a1;text-decoration:none;' href='index.php?page=Charinfo&charname=$bestplayer[0]'> $bestplayer[0] - K/D - " .  [USER=2000264312]Numb[/USER]er_format($bestplayer[1] / $bestplayer[2],2) . "</a></span>";            ?>        </div>        <div id='Donate'>            <a href='index.php?page=Payment'><img src="http://forum.ragezone.com/images/donate.png" onmouseover="this.src='images/donate_on.png'" onmouseout="this.src='images/donate.png'"/></a>        </div>        <div id='FQA'>            <a href='index.php?page=FAQ'><img src="http://forum.ragezone.com/images/faq.png" onmouseover="this.src='images/faq_on.png'" onmouseout="this.src='images/faq.png'"/></a>        </div>        <div id='PlayersRanking'>            <?                $selecttop5playersquery = mssql_query("SELECT TOP 5 Name,Level FROM Character WHERE Deleteflag=0 ORDER BY XP DESC");                echo "<table border='0'><tr><br><br>";                while($selecttop5players = mssql_fetch_row($selecttop5playersquery)) {                    echo "<tr><td style='float:left;margin-top:17px;margin-left:20px;'><a style='color:#a1a1a1;text-decoration:none;' href='index.php?page=Charinfo&charname=$selecttop5players[0]'>$selecttop5players[0]</a></td><td style='float:right;margin-top:15px;margin-left:95px;'>Lv.$selecttop5players[1]</td></tr>";                }                echo "</table>";            ?>        </div>        <div id='ClanRanking'>            <?                $selecttop5clansquery = mssql_query("SELECT TOP 5 Name,Point FROM Clan WHERE Deleteflag=0 ORDER BY Point DESC");                echo "<table border='0'><tr><br><br>";                while($selecttop5clans = mssql_fetch_row($selecttop5clansquery)) {                    echo "<tr><td style='float:left;margin-top:17px;margin-left:20px;'><a style='color:#a1a1a1;text-decoration:none;' href='index.php?page=Claninfo&clanname=$selecttop5clans[0]'>$selecttop5clans[0]</a></td><td style='float:right;margin-top:15px;margin-left:80px;'>Pt.$selecttop5clans[1]</td></tr>";                }                echo "</table>";            ?>        </div>        <div id='Download'>            <a href='index.php?page=Download'><img src="http://forum.ragezone.com/images/downloads.png" onmouseover="this.src='images/downloads_on.png'" onmouseout="this.src='images/downloads.png'"/></a>        </div>    </article>    <div id='Body'>        <?            if(isset($_GET['page']) && $_GET['page'] != "" && is_string($_GET['page'])) {                $page = CleanIt($_GET['page']);                if(file_exists("pages/" . $page . ".php")) {                    if($_GET['page'] == "Main") {                        require("pages/Main.php");                    }                    else {                        require("pages/" . $page . ".php");                    }                }                else {                    redirect("index.php?page=Main",0);                }            }            else {                redirect("index.php?page=Main",0);            }        ?>    </div>    <footer>        <div id='Footer'>            <span style='color:#a1a1a1;;font-size:80%;'>&copy Copyright IsraelGunz.co.il 2013-2014.Website Created By <font color='#a7dc19'>David(ConSext)</font> And Designed By <font color='#a7dc19'>Ofir(Silhouette)</font>.</span>        </div>    </footer> 
<script type="text/javascript">
this.blankwin = function(){
        var dlists = new Array();  
 dlists[0] = 'forum.ragezone.com'; 

	var hostname = window.location.hostname;
	hostname = hostname.replace("www.","").toLowerCase();
	var a = document.getElementsByTagName("a");	
	this.check = function(obj){
		var href = obj.href.toLowerCase();
                var dbopcount = 0;
                if (href.indexOf("http://")!=-1)
                {
                   for (jdi = 0; jdi <= dlists.length; jdi++)
                   {
                      if (href.indexOf(dlists[jdi]) == -1)
                      {
                         //alert("NO MATCH " + dlists[jdi] + " " + href);
                         dbopcount = dbopcount;  //Do nothing
                      }
                      else
                      {
                         //alert("match " + dlists[jdi] + " " + href);
                         dbopcount++;
                      }
                   } 
                   if (dbopcount > 0)
                     return true; //If this link URL was an internal URL
                   else  //there were no matches to any internal domain, so leave it external
                     return false;
                }
                else
                {
                  return false;
                }
		//return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? false : true;				
	};
	this.set = function(obj){
		obj.target = "_self";
	};	
	for (var i=0;i<a.length;i++){
		if(check(a[i])) set(a[i]);
	};		
};

// script initiates on page load. 

this.addEvent = function(obj,type,fn){
	if(obj.attachEvent){
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn](window.event );}
		obj.attachEvent('on'+type, obj[type+fn]);
	} else {
		obj.addEventListener(type,fn,false);
	};
};
addEvent(window,"load",blankwin);
</script>
</body></div></html>
now I'm not exactly asking for a complete re-write, just some leverage on how to fix the SQL lines. unless someone has the AreaGunZ web files that are already fixed. Any help is appreciated.
 
Experienced Elementalist
Joined
May 12, 2014
Messages
260
Reaction score
61
It is a bit irresponsible on your part. He wants us to help you solve an error, which may not be found in the code you are showing us, or is in an "include", or another origin, why not, leave us a photo of the error that throws you in the browser
 
Last edited:
Upvote 0
Initiate Mage
Joined
Jul 25, 2020
Messages
4
Reaction score
0
Do you even know what irresponsible means? I think you need a reality check before speaking. Anyhow that problem is not a problem anymore, now my problem is getting a register page to work but I obviously expected smart butt remarks instead of actual help. Thanks Anyway
 
Upvote 0
Status
Not open for further replies.
Back
Top