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!

PHP Login problem in my website

Joined
Jul 11, 2012
Messages
786
Reaction score
190
hello guys, I am working on my new gunz website .. but I have a problem with login page ( and I'm too lazy to look in google cuz I work sorry hhh xD). the problem is when I login to an account, Okay it logs in .. but when I move to another page in the website like from rankings to download or to shop it shows the form of login again ( like it logs out, it doesn't stay logged in) how can I keep it logged in xD..
PHP pros help please <3
 
Pee Aitch Pee
Joined
Mar 30, 2011
Messages
630
Reaction score
422


Also take a look at the examples. ^
 
Upvote 0
Joined
Jul 11, 2012
Messages
786
Reaction score
190
Make sure your actually creating the login session / checking if there is an active session.
Hard to help without code snippets.

o.o what code should I put, to let u understand better xD :$ ??



Also take a look at the examples. ^

I'll look at it.. thanks :):
if it didn't work I'll tell u and hope u can help me !
 
Upvote 0
Joined
Sep 1, 2011
Messages
453
Reaction score
191
o.o what code should I put, to let u understand better xD :$ ??
Well normally login scripts are just if statements that check if the posted username exists and if the usernames' password is correct with the password in the database then it would create a session.
You can easily create a session using

Example
PHP:
session_start(); // this should be at the top of all your pages. http://php.net/manual/en/function.session-start.php

$_SESSION['username'] = $user_variable; //im creating a session for the user (this would be after u verified the username / password ) where $user_variable is the posted username. And the session is set.

//to check if the session is alive or is set (meaning the user is logged in)
if(!isset($_SESSION['username')){ 
      //user isnt logged in (display the login form) 
} else { 
     //user is logged in (display the userpanel links or w/e u wanted there) 
}
 
Last edited:
Upvote 0
Joined
Jul 11, 2012
Messages
786
Reaction score
190
Well normally login scripts are just if statements that check if the posted username exists and if the usernames' password is correct with the password in the database then it would create a session.
You can easily create a session using

Example
PHP:
session_start(); // this should be at the top of all your pages. http://php.net/manual/en/function.session-start.php

$_SESSION['username'] = $user_variable; //im creating a session for the user (this would be after u verified the username / password ) where $user_variable is the posted username. And the session is set.

//to check if the session is alive or is set (meaning the user is logged in)
if(!isset($_SESSION['username')){ 
      //user isnt logged in (display the login form) 
} else { 
     //user is logged in (display the userpanel links or w/e u wanted there) 
}
Yeah, I checked my pages and I think the problem is session_start, because it's missing xD .. so you told me it should be at the first of all my pages.. but do you mean all of them like download and rankings .. or enough just for pages like reset password and login and shop (that requires login :): )?
 
Upvote 0
Joined
Sep 1, 2011
Messages
453
Reaction score
191
Yeah, I checked my pages and I think the problem is session_start, because it's missing xD .. so you told me it should be at the first of all my pages.. but do you mean all of them like download and rankings .. or enough just for pages like reset password and login and shop (that requires login :): )?

Use session_start() once in every file you access the $_SESSION variable.
Once u use that function in that specific file it shouldnt be declared agian in that file ex:

if i had two pages
index.php
admin.php
(assuming index didn't include admin.php)
you would put session_start() at the top on each of the files.

if you had two pages but the index included the other like so
index.php
index.php?page=admin //includes /pages/admin.php
you would only put it at the top of index.php

I hope i made it clear :)
Regards.
 
Upvote 0
Joined
Jul 11, 2012
Messages
786
Reaction score
190
Use session_start() once in every file you access the $_SESSION variable.
Once u use that function in that specific file it shouldnt be declared agian in that file ex:

if i had two pages
index.php
admin.php
(assuming index didn't include admin.php)
you would put session_start() at the top on each of the files.

if you had two pages but the index included the other like so
index.php
index.php?page=admin //includes /pages/admin.php
you would only put it at the top of index.php

I hope i made it clear :)
Regards.

Okay, I've understood you very good.. and I've put session_start(); at the top of index page, cuz it's true as you said my index contains all pages .. but when I enter the website, it enters but shows this error at the top of the page.
Code:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\AppServ\www\Index.php:6) in C:\AppServ\www\Index.php on line 12

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\Index.php:6) in C:\AppServ\www\Index.php on line 12
what in the world is that exactly hhhh.. :p
 
Upvote 0
Hi, I'm Omar!
Member
Joined
Jan 6, 2011
Messages
1,345
Reaction score
646
Okay, I've understood you very good.. and I've put session_start(); at the top of index page, cuz it's true as you said my index contains all pages .. but when I enter the website, it enters but shows this error at the top of the page.
Code:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\AppServ\www\Index.php:6) in C:\AppServ\www\Index.php on line 12

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\AppServ\www\Index.php:6) in C:\AppServ\www\Index.php on line 12
what in the world is that exactly hhhh.. :p

Post your index.php.
 
Upvote 0
Joined
Jul 11, 2012
Messages
786
Reaction score
190
Here you go bro
PHP:
<!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">

<?PHP
 ///////////////////////////
 ///  Coded By Tannous /////
 ///////////////////////////
 require('Secure/Config.php');
 require('Secure/Functions.php');
 ///////////////////////////
 session_start();
 ///////////////////////////
?>
 
<head>
 <style type="text/css">
	.blat{
  background:url('images/login_btn.png') no-repeat;
  width:64px;
  height:21px;
  border:none;
  position:absolute;}
  .blat:hover{
  background:url('images/login_btn_on.png') no-repeat;
  width:64px;
  height:21px;
  border:none;
  position:absolute;}
 </style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="description" content="Gunz: The Duel, Full Free Server"/>
<meta name="keywords" content="Gunz Online Free Multiple Play Game."/>
<meta name="author" content="Tannous(Conan), Tannous_94@hotmail.com"/>

<link rel="icon" href="img/favicon.ico"/>
 
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<link href="css/qpop.css" rel="stylesheet" type="text/css"/>
<link href="css/clan-news-bar.css" rel="stylesheet" type="text/css"/>
<link href="css/jquery-bubble-popup-v3.css" rel="stylesheet" type="text/css"/>
<link href="css/e.window.css" rel="stylesheet" type="text/css"/>
 
<script src="js/jsfunctions.js"></script>
<script src="js/ajax_functions.js"></script>
<script src="js/ajax_functions_2.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/ev.window.js"></script>
 
 
<link href="js/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="js/jquery.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
 
<script src="js/qpop.js" type="text/javascript"></script>
<script src="js/jquery-bubble-popup-v3.min.js" type="text/javascript"></script>
 
 
<script type="text/javascript" src="includes/jscolor/jscolor_.js"></script>
<script src="js/custom-form.js"></script>
<script src="js/slides.min.jquery.js"></script>
<script src="js/tscroll.js"></script>
<script type="text/javascript" src="js/news.js"></script>
<script type="text/javascript">
		$(function(){
			$('#slides').slides({
				preload: true,
				preloadImage: 'img/loading.gif',
				play: 5000,
				pause: 2500,
				hoverPause: true,
				animationStart: function(current){
					$('.caption').animate({
						bottom:-35
					},100);
					if (window.console == true && console.log == true) {
						// example return of current slide number
						//console.log('animationStart on slide: ', current);
					};
				},
				animationComplete: function(current){
					$('.caption').animate({
						bottom:0
					},200);
					if (window.console && console.log) {
						// example return of current slide number
						//console.log('animationComplete on slide: ', current);
					};
				},
				slidesLoaded: function() {
					$('.caption').animate({
						bottom:0
					},200);
				}
			});
		});

<!-- Begin
loadImage0 = new Image();
loadImage0.src = "http://forum.ragezone.com/images/nav-home_on.png";
staticImage0 = new Image();
staticImage0.src = "http://forum.ragezone.com/images/nav-home.png";

loadImage1 = new Image();
loadImage1.src = "http://forum.ragezone.com/images/nav-reg_on.png";
staticImage1 = new Image();
staticImage1.src = "http://forum.ragezone.com/images/nav-reg.png";

loadImage2 = new Image();
loadImage2.src ="http://forum.ragezone.com/images/nav-down_on.png";
staticImage2 = new Image();
staticImage2.src = "http://forum.ragezone.com/images/nav-down.png";

loadImage3 = new Image();
loadImage3.src = "http://forum.ragezone.com/images/nav-logo_on.png";
staticImage3 = new Image();
staticImage3.src = "http://forum.ragezone.com/images/nav-logo.png";

loadImage4 = new Image();
loadImage4.src = "http://forum.ragezone.com/images/nav-clan_on.png";
staticImage4 = new Image();
staticImage4.src = "http://forum.ragezone.com/images/nav-clan.png";

loadImage5 = new Image();
loadImage5.src = "http://forum.ragezone.com/images/nav-mark_on.png";
staticImage5 = new Image();
staticImage5.src = "http://forum.ragezone.com/images/nav-mark.png";

loadImage6 = new Image();
loadImage6.src = "http://forum.ragezone.com/images/nav-com_on.png";
staticImage6 = new Image();
staticImage6.src = "http://forum.ragezone.com/images/nav-com.png";

loadImage7 = new Image();
loadImage7.src = "http://forum.ragezone.com/images/donate_on.png";
staticImage7 = new Image();
staticImage7.src = "http://forum.ragezone.com/images/donate.png";

loadImage8 = new Image();
loadImage8.src = "http://forum.ragezone.com/images/ranking_on.png";
staticImage8 = new Image();
staticImage8.src = "http://forum.ragezone.com/images/ranking.png";

loadImage9 = new Image();
loadImage9.src = "http://forum.ragezone.com/images/login_btn_on.png";
staticImage9 = new Image();
staticImage9.src = "http://forum.ragezone.com/images/login_btn.png";


loadImage10 = new Image();
loadImage10.src = "http://forum.ragezone.com/images/register_on.png";
staticImage10 = new Image();
staticImage10.src = "http://forum.ragezone.com/images/register.png";

loadImage11 = new Image();
loadImage11.src = "http://forum.ragezone.com/images/prank_on.jpg";
staticImage11 = new Image();
staticImage11.src = "http://forum.ragezone.com/images/prank.jpg";

loadImage12 = new Image();
loadImage12.src = "http://forum.ragezone.com/images/crank_on.jpg";
staticImage12 = new Image();
staticImage12.src = "http://forum.ragezone.com/images/crank.jpg";


loadImage13 = new Image();
loadImage13.src = "http://forum.ragezone.com/images/ptime_on.jpg";
staticImage13 = new Image();
staticImage13.src = "http://forum.ragezone.com/images/ptime.jpg";
// End -->
</script>
 
 
<title>.: <?=$gzname?> :.</title>
 
<meta name="pinterest" content="nopin"/></head>
 
 
<body>
 
<div style="position: absolute; top: 50%; left: 0%; margin-top: -300px;">
</div>
<div style="position: absolute; top: 50%; right: 0%; margin-top: -300px;">
</div>
 
 
<div id="fb-root"></div>
 
 
<div class="qpop" style="display:none;">
<div class="qpop-modal">
</div>
<div class="qpop-message">
<div class="qpop-message-head">
<img class="qpop-head-exit" src="http://forum.ragezone.com/images/mini_exit.png" onclick="$('.qpop').qPopHide();"/>
</div>
<div class="qpop-message-body">
</div>
</div>
</div>
<script type="text/javascript">
			$(".qpop").qPopMake({
				width: 700,
				height: 600,
				//url: "ajax/load_post.php?ad=1",
			});

			function testmodal () {
				$(".qpop").qPopShow();
			}
		</script>
 
 
<div id="main-container">
 
 
 
 
 
<div id="header">
 
<div id="navbar" align="center">
<a href="index.php" onmouseover="image0.src=loadImage0.src;" onmouseout="image0.src=staticImage0.src;">
<img name="image0" align="top" src="http://forum.ragezone.com/images/nav-home.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="114" width="121"></img></a>
<a href="index.php?page=register" onmouseover="image1.src=loadImage1.src;" onmouseout="image1.src=staticImage1.src;">
<img name="image1" align="top" src="http://forum.ragezone.com/images/nav-reg.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="109" width="99"></img></a>
<a href="index.php?page=download" onmouseover="image2.src=loadImage2.src;" onmouseout="image2.src=staticImage2.src;">
<img name="image2" align="top" src="http://forum.ragezone.com/images/nav-down.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="95" width="98"></img></a>
<a href="index.php" onmouseover="image3.src=loadImage3.src;" onmouseout="image3.src=staticImage3.src;">
<img name="image3" align="top" src="http://forum.ragezone.com/images/nav-logo.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="92" width="195"></img></a>
<a href="#" onmouseover="image4.src=loadImage4.src;" onmouseout="image4.src=staticImage4.src;">
<img name="image4" align="top" src="http://forum.ragezone.com/images/nav-clan.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="95" width="89"></img></a>
<a href="#" onmouseover="image5.src=loadImage5.src;" onmouseout="image5.src=staticImage5.src;">
<img name="image5" align="top" src="http://forum.ragezone.com/images/nav-mark.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="106" width="94"></img></a>
<a href="http://forum.ragezone.com/f311" onmouseover="image6.src=loadImage6.src;" onmouseout="image6.src=staticImage6.src;">
<img name="image6" align="top" src="http://forum.ragezone.com/images/nav-com.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="113" width="134"></img></a>
</div> 
 
<div id="content">
<div><div></div><div><div></div></div><div><div><div></div></div></div></div><div><div>
</div><div><div></div></div><div><div><div></div></div></div></div>  
<div id="leftcontent">
<?php
 require('pages/login.php');
?>
<div id="status">
<div id="servstat">
SERVER STATUS
</div>
<div id="onoff">
<?php

    $ip = $_SERVER['REMOTE_ADDR'];
	$query = odbc_exec($connect, "SELECT * FROM ServerStatus(nolock) WHERE Opened != 0");
    while( $data = odbc_fetch_object($query) )
    {
        $ip = $data->IP;
        $port = $data->Port;
        $check = @fsockopen($ip, $port, $errno, $errstr, 1);

        if (!$check)
        {
            echo "SERVER STATUS : <span style='color:RED; float:right; margin-right:4px;'>OFFLINE</span>";
        }
        else
        {
            echo "SERVER STATUS : <span style='color:#0C0; float:right; margin-right:4px;'>ONLINE</span>";
            fclose($check);
        }
	}
?>
</div>
<div id="players">
<?php
  $query = odbc_exec($connect, "SELECT CurrPlayer FROM ServerStatus");
  odbc_fetch_row($query);
  $players = odbc_result($query, 1);
  echo "PLAYERS ONLINE : <span style='color:#0C0; float:right; margin-right:4px;'>".$players."/500</span>";
  ?>
</div>
<div id="current">
CURRENTLY RUNNING EVENTS :
</div>
<div id="events">
> LMS EVENT
</div>
<div id="events">
> RFA EVENT
</div>
<div id="events">
> KTA EVENT
</div>
<div id="events">
> RFR EVENT
</div>
<div id="events">
> RFS EVENT
</div>
<div id="events">
> RACE EVENT
</div>
</div> 
 
<div id="donate">
<a href="#" onmouseover="image7.src=loadImage7.src;" onmouseout="image7.src=staticImage7.src;">
<img name="image7" align="top" src="http://forum.ragezone.com/images/donate.png" id="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="72" width="183"></img></a></div> 
</div>
 
<div id="middlecontent">
  <?php
                if(isset($_GET['page']) && $_GET['page'] != "")
                {
                  if(file_exists('pages/'.$_GET['page'].'.php'))
                  {
                    require('pages/'.$_GET['page'].'.php');
                  }
                  else
                  {
                    require('pages/home.php');
                  }
                }
                else
                {
                  require('pages/home.php');
                }
       ?>
</div> 
 
<div id="rightcontent">
 
<div id="download">
<a href="index.php?page=download">
<img src="http://forum.ragezone.com/images/download.png" border="0"/>
</a>
</div> 
 
<div id="weekly">
<div id="weeklyti">
TOP INDIVIDUAL RANKING
</div>
<div id="weeklytit">
NAME <span style="margin-left: 95px;">LEVEL</span>
</div>
<?PHP
$query = mssql_query("SELECT TOP 4 Name, Level FROM Character WHERE DeleteFlag = 0 ORDER BY Level DESC");
    while($row = mssql_fetch_row($query))
    {
      echo '<div id="weekrnk1">'.$row[0].'<span style="float: right;"> LV. '.$row[1].'</span></div><br>';
    }

?>
</div> 
 
<div id="weekly">
<div id="weeklyti">
TOP CLAN RANKING
</div>
<div id="weeklytit">
NAME <span style="margin-left: 95px;">POINTS</span>
</div>
<?PHP
$query = mssql_query("SELECT TOP 4 Name, Point FROM Clan WHERE DeleteFlag = 0 ORDER BY Point DESC");
    while($row = mssql_fetch_row($query))
    {
      echo '<div id="weekrnk1">'.$row[0].'<span style="float: right;"> PT. '.$row[1].'</span></div><br>';
    }

?>
</div> 
 
<div id="ranking">
<a href="#" onmouseover="image8.src=loadImage8.src;" onmouseout="image8.src=staticImage8.src;">
<img name="image8" src="http://forum.ragezone.com/images/ranking.png" id="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="78" width="189"></img></a>
</div> 
</div>
 
 
</div>
</div>
 
 
<div id="footer" align="center">
<img src="http://forum.ragezone.com/images/footer2.png" border="0"/><br>
<img src="http://forum.ragezone.com/images/footer3.png" border="0"/>
</div>
 
 
<div id="disclaimer" align="center">

</div>
 
</div>
 
</body>
 
</html>
 
Upvote 0
Pee Aitch Pee
Joined
Mar 30, 2011
Messages
630
Reaction score
422
The session_start function must be called before you're outputting any content.
 
Upvote 0
Hi, I'm Omar!
Member
Joined
Jan 6, 2011
Messages
1,345
Reaction score
646
Code:
<?php
 session_start();
?>
<!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">

<?PHP
 ///////////////////////////
 ///  Coded By Tannous /////
 ///////////////////////////
 require('Secure/Config.php');
 require('Secure/Functions.php');
 ///////////////////////////
 ///////////////////////////
?>
 
<head>
 <style type="text/css">
    .blat{
  background:url('images/login_btn.png') no-repeat;
  width:64px;
  height:21px;
  border:none;
  position:absolute;}
  .blat:hover{
  background:url('images/login_btn_on.png') no-repeat;
  width:64px;
  height:21px;
  border:none;
  position:absolute;}
 </style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="description" content="Gunz: The Duel, Full Free Server"/>
<meta name="keywords" content="Gunz Online Free Multiple Play Game."/>
<meta name="author" content="Tannous(Conan), Tannous_94@hotmail.com"/>

<link rel="icon" href="img/favicon.ico"/>
 
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<link href="css/qpop.css" rel="stylesheet" type="text/css"/>
<link href="css/clan-news-bar.css" rel="stylesheet" type="text/css"/>
<link href="css/jquery-bubble-popup-v3.css" rel="stylesheet" type="text/css"/>
<link href="css/e.window.css" rel="stylesheet" type="text/css"/>
 
<script src="js/jsfunctions.js"></script>
<script src="js/ajax_functions.js"></script>
<script src="js/ajax_functions_2.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/ev.window.js"></script>
 
 
<link href="js/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="js/jquery.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
 
<script src="js/qpop.js" type="text/javascript"></script>
<script src="js/jquery-bubble-popup-v3.min.js" type="text/javascript"></script>
 
 
<script type="text/javascript" src="includes/jscolor/jscolor_.js"></script>
<script src="js/custom-form.js"></script>
<script src="js/slides.min.jquery.js"></script>
<script src="js/tscroll.js"></script>
<script type="text/javascript" src="js/news.js"></script>
<script type="text/javascript">
        $(function(){
            $('#slides').slides({
                preload: true,
                preloadImage: 'img/loading.gif',
                play: 5000,
                pause: 2500,
                hoverPause: true,
                animationStart: function(current){
                    $('.caption').animate({
                        bottom:-35
                    },100);
                    if (window.console == true && console.log == true) {
                        // example return of current slide number
                        //console.log('animationStart on slide: ', current);
                    };
                },
                animationComplete: function(current){
                    $('.caption').animate({
                        bottom:0
                    },200);
                    if (window.console && console.log) {
                        // example return of current slide number
                        //console.log('animationComplete on slide: ', current);
                    };
                },
                slidesLoaded: function() {
                    $('.caption').animate({
                        bottom:0
                    },200);
                }
            });
        });

<!-- Begin
loadImage0 = new Image();
loadImage0.src = "http://forum.ragezone.com/images/nav-home_on.png";
staticImage0 = new Image();
staticImage0.src = "http://forum.ragezone.com/images/nav-home.png";

loadImage1 = new Image();
loadImage1.src = "http://forum.ragezone.com/images/nav-reg_on.png";
staticImage1 = new Image();
staticImage1.src = "http://forum.ragezone.com/images/nav-reg.png";

loadImage2 = new Image();
loadImage2.src ="http://forum.ragezone.com/images/nav-down_on.png";
staticImage2 = new Image();
staticImage2.src = "http://forum.ragezone.com/images/nav-down.png";

loadImage3 = new Image();
loadImage3.src = "http://forum.ragezone.com/images/nav-logo_on.png";
staticImage3 = new Image();
staticImage3.src = "http://forum.ragezone.com/images/nav-logo.png";

loadImage4 = new Image();
loadImage4.src = "http://forum.ragezone.com/images/nav-clan_on.png";
staticImage4 = new Image();
staticImage4.src = "http://forum.ragezone.com/images/nav-clan.png";

loadImage5 = new Image();
loadImage5.src = "http://forum.ragezone.com/images/nav-mark_on.png";
staticImage5 = new Image();
staticImage5.src = "http://forum.ragezone.com/images/nav-mark.png";

loadImage6 = new Image();
loadImage6.src = "http://forum.ragezone.com/images/nav-com_on.png";
staticImage6 = new Image();
staticImage6.src = "http://forum.ragezone.com/images/nav-com.png";

loadImage7 = new Image();
loadImage7.src = "http://forum.ragezone.com/images/donate_on.png";
staticImage7 = new Image();
staticImage7.src = "http://forum.ragezone.com/images/donate.png";

loadImage8 = new Image();
loadImage8.src = "http://forum.ragezone.com/images/ranking_on.png";
staticImage8 = new Image();
staticImage8.src = "http://forum.ragezone.com/images/ranking.png";

loadImage9 = new Image();
loadImage9.src = "http://forum.ragezone.com/images/login_btn_on.png";
staticImage9 = new Image();
staticImage9.src = "http://forum.ragezone.com/images/login_btn.png";


loadImage10 = new Image();
loadImage10.src = "http://forum.ragezone.com/images/register_on.png";
staticImage10 = new Image();
staticImage10.src = "http://forum.ragezone.com/images/register.png";

loadImage11 = new Image();
loadImage11.src = "http://forum.ragezone.com/images/prank_on.jpg";
staticImage11 = new Image();
staticImage11.src = "http://forum.ragezone.com/images/prank.jpg";

loadImage12 = new Image();
loadImage12.src = "http://forum.ragezone.com/images/crank_on.jpg";
staticImage12 = new Image();
staticImage12.src = "http://forum.ragezone.com/images/crank.jpg";


loadImage13 = new Image();
loadImage13.src = "http://forum.ragezone.com/images/ptime_on.jpg";
staticImage13 = new Image();
staticImage13.src = "http://forum.ragezone.com/images/ptime.jpg";
// End -->
</script>
 
 
<title>.: <?=$gzname?> :.</title>
 
<meta name="pinterest" content="nopin"/></head>
 
 
<body>
 
<div style="position: absolute; top: 50%; left: 0%; margin-top: -300px;">
</div>
<div style="position: absolute; top: 50%; right: 0%; margin-top: -300px;">
</div>
 
 
<div id="fb-root"></div>
 
 
<div class="qpop" style="display:none;">
<div class="qpop-modal">
</div>
<div class="qpop-message">
<div class="qpop-message-head">
<img class="qpop-head-exit" src="http://forum.ragezone.com/images/mini_exit.png" onclick="$('.qpop').qPopHide();"/>
</div>
<div class="qpop-message-body">
</div>
</div>
</div>
<script type="text/javascript">
            $(".qpop").qPopMake({
                width: 700,
                height: 600,
                //url: "ajax/load_post.php?ad=1",
            });

            function testmodal () {
                $(".qpop").qPopShow();
            }
        </script>
 
 
<div id="main-container">
 
 
 
 
 
<div id="header">
 
<div id="navbar" align="center">
<a href="index.php" onmouseover="image0.src=loadImage0.src;" onmouseout="image0.src=staticImage0.src;">
<img name="image0" align="top" src="http://forum.ragezone.com/images/nav-home.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="114" width="121"></img></a>
<a href="index.php?page=register" onmouseover="image1.src=loadImage1.src;" onmouseout="image1.src=staticImage1.src;">
<img name="image1" align="top" src="http://forum.ragezone.com/images/nav-reg.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="109" width="99"></img></a>
<a href="index.php?page=download" onmouseover="image2.src=loadImage2.src;" onmouseout="image2.src=staticImage2.src;">
<img name="image2" align="top" src="http://forum.ragezone.com/images/nav-down.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="95" width="98"></img></a>
<a href="index.php" onmouseover="image3.src=loadImage3.src;" onmouseout="image3.src=staticImage3.src;">
<img name="image3" align="top" src="http://forum.ragezone.com/images/nav-logo.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="92" width="195"></img></a>
<a href="#" onmouseover="image4.src=loadImage4.src;" onmouseout="image4.src=staticImage4.src;">
<img name="image4" align="top" src="http://forum.ragezone.com/images/nav-clan.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="95" width="89"></img></a>
<a href="#" onmouseover="image5.src=loadImage5.src;" onmouseout="image5.src=staticImage5.src;">
<img name="image5" align="top" src="http://forum.ragezone.com/images/nav-mark.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="106" width="94"></img></a>
<a href="http://forum.ragezone.com/f311" onmouseover="image6.src=loadImage6.src;" onmouseout="image6.src=staticImage6.src;">
<img name="image6" align="top" src="http://forum.ragezone.com/images/nav-com.png" class="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="113" width="134"></img></a>
</div> 
 
<div id="content">
<div><div></div><div><div></div></div><div><div><div></div></div></div></div><div><div>
</div><div><div></div></div><div><div><div></div></div></div></div>  
<div id="leftcontent">
<?php
 require('pages/login.php');
?>
<div id="status">
<div id="servstat">
SERVER STATUS
</div>
<div id="onoff">
<?php

    $ip = $_SERVER['REMOTE_ADDR'];
    $query = odbc_exec($connect, "SELECT * FROM ServerStatus(nolock) WHERE Opened != 0");
    while( $data = odbc_fetch_object($query) )
    {
        $ip = $data->IP;
        $port = $data->Port;
        $check = @fsockopen($ip, $port, $errno, $errstr, 1);

        if (!$check)
        {
            echo "SERVER STATUS : <span style='color:RED; float:right; margin-right:4px;'>OFFLINE</span>";
        }
        else
        {
            echo "SERVER STATUS : <span style='color:#0C0; float:right; margin-right:4px;'>ONLINE</span>";
            fclose($check);
        }
    }
?>
</div>
<div id="players">
<?php
  $query = odbc_exec($connect, "SELECT CurrPlayer FROM ServerStatus");
  odbc_fetch_row($query);
  $players = odbc_result($query, 1);
  echo "PLAYERS ONLINE : <span style='color:#0C0; float:right; margin-right:4px;'>".$players."/500</span>";
  ?>
</div>
<div id="current">
CURRENTLY RUNNING EVENTS :
</div>
<div id="events">
> LMS EVENT
</div>
<div id="events">
> RFA EVENT
</div>
<div id="events">
> KTA EVENT
</div>
<div id="events">
> RFR EVENT
</div>
<div id="events">
> RFS EVENT
</div>
<div id="events">
> RACE EVENT
</div>
</div> 
 
<div id="donate">
<a href="#" onmouseover="image7.src=loadImage7.src;" onmouseout="image7.src=staticImage7.src;">
<img name="image7" align="top" src="http://forum.ragezone.com/images/donate.png" id="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="72" width="183"></img></a></div> 
</div>
 
<div id="middlecontent">
  <?php
                if(isset($_GET['page']) && $_GET['page'] != "")
                {
                  if(file_exists('pages/'.$_GET['page'].'.php'))
                  {
                    require('pages/'.$_GET['page'].'.php');
                  }
                  else
                  {
                    require('pages/home.php');
                  }
                }
                else
                {
                  require('pages/home.php');
                }
       ?>
</div> 
 
<div id="rightcontent">
 
<div id="download">
<a href="index.php?page=download">
<img src="http://forum.ragezone.com/images/download.png" border="0"/>
</a>
</div> 
 
<div id="weekly">
<div id="weeklyti">
TOP INDIVIDUAL RANKING
</div>
<div id="weeklytit">
NAME <span style="margin-left: 95px;">LEVEL</span>
</div>
<?PHP
$query = mssql_query("SELECT TOP 4 Name, Level FROM Character WHERE DeleteFlag = 0 ORDER BY Level DESC");
    while($row = mssql_fetch_row($query))
    {
      echo '<div id="weekrnk1">'.$row[0].'<span style="float: right;"> LV. '.$row[1].'</span></div><br>';
    }

?>
</div> 
 
<div id="weekly">
<div id="weeklyti">
TOP CLAN RANKING
</div>
<div id="weeklytit">
NAME <span style="margin-left: 95px;">POINTS</span>
</div>
<?PHP
$query = mssql_query("SELECT TOP 4 Name, Point FROM Clan WHERE DeleteFlag = 0 ORDER BY Point DESC");
    while($row = mssql_fetch_row($query))
    {
      echo '<div id="weekrnk1">'.$row[0].'<span style="float: right;"> PT. '.$row[1].'</span></div><br>';
    }

?>
</div> 
 
<div id="ranking">
<a href="#" onmouseover="image8.src=loadImage8.src;" onmouseout="image8.src=staticImage8.src;">
<img name="image8" src="http://forum.ragezone.com/images/ranking.png" id="btnFreeGame" alt="" style="cursor: pointer;" onclick="toggleFreeArea();" border="0" height="78" width="189"></img></a>
</div> 
</div>
 
 
</div>
</div>
 
 
<div id="footer" align="center">
<img src="http://forum.ragezone.com/images/footer2.png" border="0"/><br>
<img src="http://forum.ragezone.com/images/footer3.png" border="0"/>
</div>
 
 
<div id="disclaimer" align="center">

</div>
 
</div>
 
</body>
 
</html>
 
Upvote 0
Joined
Jul 11, 2012
Messages
786
Reaction score
190
YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEES, it worked, sorry I'm stupid (I put it at the line before require('Secure/Config.php');) xD
and Secured, SuperWaffle, Vusion ... Guys I love you so much, I dunnu how I'm going to thank you :(: ..
but what I wanted to ask is: why didn't it work at the line where I put it, I mean what's the difference xD !?
 
Upvote 0
Hi, I'm Omar!
Member
Joined
Jan 6, 2011
Messages
1,345
Reaction score
646
Because you declared the HTML DocType before you declared session_start()
As SuperPotato Said,

He's asking why does it have to be on top. He already knows it should be on top.
 
Upvote 0
Back
Top