Jump to content

Tassadar

Members
  • Posts

    32
  • Joined

  • Last visited

Posts posted by Tassadar

  1. Since its just me working on it, and Im learning PHP as I develop the game.. who the hell knows lol. If I had another programmer (preferably someone advanced) it would go a LOT quicker. Its going to be sort of like starcraft, but inter-planetary attacks and defenses. You build up your outpost and you are part of a colony which is 20 different players (outposts). then its basically colony vs colony. Wars, and alliances etc. I also have some pretty badass twists in the storyline that will change gameplay. My host already has unlimited bandwidth and connections so I could have virtually thousands of people on at any given time without any major connection issues. 

  2. Sorry for the late reply, didn't see there was one. Yeah its a text-based browser game. Nothing too overly complicated, no crazy CGI. but I have a LOT going for the story line and plenty of ideas.. I just need to figure out how to do them! Cron jobs are killing me right now, and trying to figure out formulas etc.. 

  3. again, I appreciate the help. I know it has to be frustrating working with someone who isn't as skilled with PHP/SQL  :happy-04:

     

    btw, in case you were wondering what the heck I am working on, its a space RTS game that is browser-based. that would explain all the strange fields and variables ;)

  4. its reporting:

    Array //<-----Stats
    (
        [id] => 20
        [credits] => 2000
        [food] => 2000
        [land] => 100
        [energy] => 2000
        [turns] => 30
        [turns_max] => 30
        [gas] => 2000
        [ore] => 2000
        [population] => 500
        [buildeff] => 100
        [offpts] => 0
        [defpts] => 0
        [score] => 0
        [specialty] => Heavy Artillerist
    )
    Array//<-----Unit
    (
        [id] => 20
        [trainee] => 100
        [juggernaut] => 0
        [infantry] => 50
        [marauder] => 0
        [terminator] => 0
        [reconsq] => 0
        [prisoner] => 0
        [destroyer] => 0
        [colossus] => 0
    )
    Array//<-----User
    (
        [id] => 20
        [colonynum] => 1
        [username] => Tassadar
        [password] => 76d3399809a5646a8ddf9f63ce274c97
        [email] => webmaster@aurora-game.net
        [specialty] => Heavy Artillerist
        [commname] => Fenix
        [outpostname] => Mar Sara
    )
    Array//<-----Structure
    (
        [id] => 20
        [agridome] => 1
        [spaceport] => 0
        [barrack] => 5
        [researchfac] => 0
        [laserbat] => 0
        [factory] => 0
        [infirmary] => 1
        [trainingfac] => 1
    )
    Array
    (
        [id] => 20
        [credits] => 2000
        [food] => 2000
        [land] => 100
        [energy] => 2000
        [turns] => 30
        [turns_max] => 30
        [gas] => 2000
        [ore] => 2000
        [population] => 500
        [buildeff] => 100
        [offpts] => 0
        [defpts] => 0
        [score] => 0
        [specialty] => Heavy Artillerist
    )
    Array
    (
        [id] => 20
        [trainee] => 100
        [juggernaut] => 0
        [infantry] => 50
        [marauder] => 0
        [terminator] => 0
        [reconsq] => 0
        [prisoner] => 0
        [destroyer] => 0
        [colossus] => 0
    )
    Array
    (
        [id] => 20
        [colonynum] => 1
        [username] => Tassadar
        [password] => 76d3399809a5646a8ddf9f63ce274c97
        [email] => webmaster@aurora-game.net
        [specialty] => Heavy Artillerist
        [commname] => Fenix
        [outpostname] => Mar Sara
    )
    Array
    (
        [id] => 20
        [agridome] => 1
        [spaceport] => 0
        [barrack] => 5
        [researchfac] => 0
        [laserbat] => 0
        [factory] => 0
        [infirmary] => 1
        [trainingfac] => 1
    )
    

    Here's something to really throw you for a loop.. it just.. fixed itself.. I didnt change anything, I even REMOVED those strings to print out the arrays and it works fine.. posting structures, units.. everything.. the only thing I did do was delete the username fields from all but the user table.. think that could have conflicted somehow?

  5. hang on there... if you're referencing the user's info with his ID, what's the point of having the username repeated in all the databases (this makes it much harder is the username has to be changed for some reason)...

    Are you absalutely sure your script is accessing THAT database that you see in phpmyadmin, or do you have another copy  somewhere? (because you're telling me a field called commname exists in the database, but select * isn't pulling it out. You must be giving me incorrect information somewhere.

    I did this because when I have thousands of users and when I need to look someone up I dont have to find them in the USER table, then match their ID with the ID on another table if I need to edit their data. I mean I shouldnt be doing it often so I could delete the username fields from all the tables except the user table. Ill post a screenshot of my structure so you can see the commname field is there, and that I have a structure table gimmie a bit

  6. and its weird it says undefined variable: structure when the print lists the structure table just fine.. but it didnt list $user at all

     

    to get info by username do I just change 

    $stats_get = mysqli_query($myConnection,"SELECT * FROM `stats` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection));
    $stats = mysqli_fetch_assoc($stats_get);
    

    to

    $stats_get = mysqli_query($myConnection,"SELECT * FROM `stats` WHERE `username`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection));
    $stats = mysqli_fetch_assoc($stats_get);
    

    ?

  7. I put the array print out at the top, requesting info from $user, $unit, $stats, Structure and it returned:

    Array
    (
        [id] => 20
        [username] => Tassadar
        [agridome] => 1
        [spaceport] => 0
        [barrack] => 5
        [researchfac] => 0
        [laserbat] => 0
        [factory] => 0
        [infirmary] => 1
        [trainingfac] => 1
    )
    Array
    (
        [id] => 20
        [username] => Tassadar
        [credits] => 2000
        [food] => 2000
        [land] => 100
        [energy] => 2000
        [turns] => 30
        [turns_max] => 30
        [gas] => 2000
        [ore] => 2000
        [population] => 500
        [buildeff] => 100
        [offpts] => 0
        [defpts] => 0
        [score] => 0
        [specialty] => Heavy Artillerist
    )
    Array
    (
        [id] => 20
        [username] => Tassadar
        [trainee] => 100
        [juggernaut] => 0
        [infantry] => 50
        [marauder] => 0
        [terminator] => 0
        [reconsq] => 0
        [prisoner] => 0
        [destroyer] => 0
        [colossus] => 0
    )
    
    
    Notice:  Undefined variable: structure in /home/auroraadmin85/public_html/Template/aurora/main.php on line 15
    

    I suppose I could try and do it based on username? every table has an ID field in which they all match for every user, and have a Username field 

     

    so

    Structures has ID, Username, etc...

    Units has ID, Username, etc..

    Stats has ID, Username, etc..

    User has ID, Username, etc...

  8. see what's happening? 'commname' doesn't exist in there (are you sure theres a table field with that name in the database?)

    and the array $structure doesn't even exist for some reason. Are you sure you have a table called structure and that it has valid information for that specific user id you're using to pull stuff from the database?

    both tables structure and field commname exist for my user and matches the user ID on all tables. I can even provide a screenshot if ya need

  9.  

    add this somewhere just to see what's in those two arrays, so you can see all the values and index names:

    echo '<pre>';
    print_r($user);
    print_r($structure);
    echo '</pre>';

    it returns

    Array
    (
        [id] => 20
        [username] => Tassadar
        [agridome] => 1
        [spaceport] => 0
        [barrack] => 5
        [researchfac] => 0
        [laserbat] => 0
        [factory] => 0
        [infirmary] => 1
        [trainingfac] => 1
    )
    
    
    Notice:  Undefined variable: structure in /home/auroraadmin85/public_html/Template/aurora/main.php on line 128
    
    
  10. yes that issue has been solved. now on to tackling a couple smaller issues that popped up but I should be able to figure them out. thank you all for the assistance!

     

    why will it let me 

    echo $stats['credits']

    and

    echo $unit['prisoner']

     

    but not

    echo $user['commname']

    or

    echo $structure['infirmary']

     

    They both get their data from:

    safe.php

    <?php
    include("functions.php");
    $stats_get = mysqli_query($myConnection,"SELECT * FROM `stats` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection));
    $stats = mysqli_fetch_assoc($stats_get);
    
    $unit_get = mysqli_query($myConnection,"SELECT * FROM `unit` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection));
    $unit = mysqli_fetch_assoc($unit_get);
    
    $user_get = mysqli_query($myConnection,"SELECT * FROM `user` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection));
    $user = mysqli_fetch_assoc($user_get);
    
    $structure_get = mysqli_query($myConnection,"SELECT * FROM `structure` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection));
    $structure = mysqli_fetch_assoc($structure_get);
    
    
    ?>
    

    I have a table called user, and structure and it wont retrieve data from those two, but it gets data from stats and units?

  11. main page: 

    <?php 
    error_reporting(E_ALL);
    session_start();
    include("safe.php");
    include("functions.php");
    if(!isset($_SESSION['uid'])){
        		echo "Please go back and log in";
    }else{
        
        
    ?>
    
    <html>
    <meta charset="utf-8">
    <title>Aurora</title>
    <link href="../style.css" rel="stylesheet" type="text/css">
    </head>
    
    <body>
    <div style="position: relative" id="wrapper">
      <!-- Menu Panel End -->
      <div id="mainheader">
    
    </div>
      <?php include("statbar.php"); ?>
    <div id="sidebar">
      <h3>Navigation</h3>
    <?php include("ingamenav.php");?>
    <h3>Account</h3>
      <div id="login" class="login"><center><form action="/Template/login.php" method="post">
        Username:<br> <input name="username" type="text" class="tb1" maxlength="24"><br />
        Password:<br> <input class ="tb1" type="password" name="password"/><br />
        <input class="tb1" type="submit" name="login" value="Login"/>
        </form></center>
      <p><a href="#">Forgot Password</a><br>
      <a href="#">Register</a><br></p>
       </div>
      
    <h3></h3>
    <div class="banners">
    Reserved for banners
    </div>
      
    </div>
    
    <div id="content_area">
      <h1>Command Center<span></span></h1>
     <p>The Command Center gives you get a detailed inventory of your resources, military, and the status of your outpost's population.</p>
    <div style="position: relative">
    <table id="stattable" width="600">
      <tr>
        <th BGCOLOR="#660000" colspan="2" scope="row">Resources</th>
      </tr>
      <tr>
        <th scope="row">Credits</th>
        <th scope="row"><?php echo $user['credits']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Networth</th>
        <th scope="row"><?php echo $user['networth']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Turns</th>
        <th scope="row"><?php echo $user['turns']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Energy</th>
        <th scope="row"><?php echo $user['energy']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Biozene Gas</th>
        <th scope="row"><?php echo $user['gas']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Ore</th>
        <th scope="row"><?php echo $user['ore']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Food</th>
        <th scope="row"><?php echo $user['food']; ?>#</th>
      </tr>
      <tr>
        <th width="294" scope="row">Land</th>
        <th width="294" scope="row"><?php echo $user['land']; ?>#</th>
      </tr>
      <tr>
        <th BGCOLOR="#660000" colspan="2" scope="row">Your Populous</th>
      </tr>
      <tr>
        <th scope="row">Population</th>
        <th scope="row"><?php echo $user['population']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Loyalty</th>
        <th scope="row"><?php echo $user['loyalty']; ?>#</th>
      </tr>
      <tr>
        <th BGCOLOR="#660000" colspan="2" scope="row">Your Military</th>
      </tr>
      <tr>
        <th scope="row">Trainees</th>
        <th scope="row"><?php echo $user['population']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Prisoners of War</th>
        <th scope="row"><?php echo $user['prisoner']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Juggernauts</th>
        <th scope="row"><?php echo $user['juggernaut']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Infantry</th>
        <th scope="row"><?php echo $user['infantry']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Marauders</th>
        <th scope="row"><?php echo $user['marauder']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Recon Squads</th>
        <th scope="row"><?php echo $user['reconsq']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Terminator</th>
        <th scope="row"><?php echo $user['terminator']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Destroyers</th>
        <th scope="row"><?php echo $user['destroyer']; ?>#</th>
      </tr>
      </table>
    </div>
    <!--Table of Contents End -->
    
    </div><!--Content Area End -->
    
    <div id="footer">
    <p>All Rights Reserved © 2014 <a href="#">Aurora Game</a></p>
    </div><!--Footer End -->
    
    </div><!-- Wrapper End -->
    </body>
    </html>
    }
    <?php }
    

    The errors Im getting are:

    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: turns in /home/auroraadmin85/public_html/Template/aurora/statbar.php on line 14
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: gas in /home/auroraadmin85/public_html/Template/aurora/statbar.php on line 15
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: energy in /home/auroraadmin85/public_html/Template/aurora/statbar.php on line 16
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: ore in /home/auroraadmin85/public_html/Template/aurora/statbar.php on line 17
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: food in /home/auroraadmin85/public_html/Template/aurora/statbar.php on line 18
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: land in /home/auroraadmin85/public_html/Template/aurora/statbar.php on line 19
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: population in /home/auroraadmin85/public_html/Template/aurora/statbar.php on line 20
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: credits in /home/auroraadmin85/public_html/Template/aurora/main.php on line 56
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: networth in /home/auroraadmin85/public_html/Template/aurora/main.php on line 60
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: turns in /home/auroraadmin85/public_html/Template/aurora/main.php on line 64
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: energy in /home/auroraadmin85/public_html/Template/aurora/main.php on line 68
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: gas in /home/auroraadmin85/public_html/Template/aurora/main.php on line 72
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: ore in /home/auroraadmin85/public_html/Template/aurora/main.php on line 76
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: food in /home/auroraadmin85/public_html/Template/aurora/main.php on line 80
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: land in /home/auroraadmin85/public_html/Template/aurora/main.php on line 84
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: population in /home/auroraadmin85/public_html/Template/aurora/main.php on line 91
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: loyalty in /home/auroraadmin85/public_html/Template/aurora/main.php on line 95
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: population in /home/auroraadmin85/public_html/Template/aurora/main.php on line 102
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: prisoner in /home/auroraadmin85/public_html/Template/aurora/main.php on line 106
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: juggernaut in /home/auroraadmin85/public_html/Template/aurora/main.php on line 110
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: infantry in /home/auroraadmin85/public_html/Template/aurora/main.php on line 114
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: marauder in /home/auroraadmin85/public_html/Template/aurora/main.php on line 118
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: reconsq in /home/auroraadmin85/public_html/Template/aurora/main.php on line 122
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: terminator in /home/auroraadmin85/public_html/Template/aurora/main.php on line 126
    [23-Feb-2014 01:05:05 UTC] PHP Notice:  Undefined index: destroyer in /home/auroraadmin85/public_html/Template/aurora/main.php on line 130
    

    basically I include a stat bar that has some information from the user displayed on the top of the page, as well as the page displays this info and more in detail. These two pages arent getting the data from the DB.

     

    statbar.php

    <?php 
    error_reporting(E_ALL);
    include("safe.php");
    include("functions.php");
    if(!isset($_SESSION['uid'])){
        		echo "Please go back and log in";
    }else{
        
        
    ?>
    <div id="statbar">
    <center>
    [Credits: <?php echo $user['username']; ?> ⊄] 
    [Turns: <?php echo $user['turns']; ?>] 
    [Biozene: <?php echo $user['gas']; ?>] 
    [Energy: <?php echo $user['energy']; ?>] 
    [Ore: <?php echo $user['ore']; ?>] 
    [Food: <?php echo $user['food']; ?>] 
    [Land: <?php echo $user['land']; ?>] 
    [Population: <?php echo $user['population']; ?>]
    </center>
    
    
    </div>
    
    <?php }
    

    sorry its super long  :happy-04: I know what the errors actually mean though, I just gotta figure out why its not receiving that data from the DB. the only thing it IS getting is the Username. 

  12. There seems to be a lot of confusion here, and this is very hard for us to figure out because we have no idea if you're doing the things we're telling you....

    Why are you still including 'functions.php' (that had a database connection) if you've got another database connection right after that include?

    Why do you still have stripslashes() on your posted password? (that's not the issue, but it's not a good idea.. a password like HX<123>Xt would be destroyed)

    Why is ob_start() still there?

     

    All this  probably means that the code we're looking at is not the code you're working on right now... It's gonna be very hard to figure this one out if we don't know what's going on.

     

    I suggest you read through the entire post again, apply/try everything we mentioned, then post the final code here again with a detailed explanation of what's still going wrong.

    Okay lets start fresh so we are on the same page

     

    Here is what I have:

     

    checklogin.php (file that is ran when user enters their UN and PW and submits form):

    <?php
    error_reporting(E_ALL);
    include("functions.php"); //connection to DB is defined in functions.php
    
    // Define $myusername and $mypassword 
    $myusername=$_POST['username']; 
    $mypassword=$_POST['password']; 
    
    $myusername = mysqli_real_escape_string($myConnection,$myusername);
    $mypassword = mysqli_real_escape_string($myConnection,$mypassword);
    $sql="SELECT `id` FROM `user` WHERE `username`='$myusername' AND `password`='".md5($mypassword)."' limit 1";
    $result=mysqli_query($myConnection,$sql);
    
    // Mysql_num_row is counting table row
    $count=mysqli_num_rows($result);
    
    // If result matched $myusername and $mypassword, table row must be 1 row
    if($count==1){
    
    // Redirect to file "main.php" if correctly logged in
    header("location:/main.php");
    }
    else {
    echo "Wrong Username or Password";
    }
    
    ?>
    

    Function.php (which contains connection to DB):

    <?php
    error_reporting(E_ALL);
    $myConnection = connect();
    
    function connect() {
        return mysqli_connect("######","######","######","######");
    }
    
    function output($string) {
        echo "<div id=\"output\">" . $string . "</div>";
    }
    
    ?>
    
    • new php.ini file has been initialized with error reporting set to ON
    • removed stripslashes (ill have to get some kind of protection once I get this working)
    • OB start/end has been removed

    It runs everything but still redirects back to Index page rather than moving onto main.php

     

    It has something to do with the main.php form it loads when you log in:

    <?php 
    error_reporting(E_ALL);
    session_start();
    include("functions.php");
    if(!isset($_SESSION['uid'])){
        $url = '/Template/index.html';
        		echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
    }else{
        include("safe.php");
        
    ?>
    

    should I be using if(!isset($_SESSION['id'])){ instead?

  13. well that was a flop and just made things messier. I need to figure out how to define my session key.. whether it be $_SESSION['user'] or $_SESSION['uid'] or whatever.. how exactly do I set this? I think my whole problem is that my sessions are screwed up on my pages

  14. where and how is $_SESSION['uid'] being set?

    good question. I followed a tutorial a while back (which worked for me then) and it used that so I stuck with it. nothing comes up as undefined though.. hmm

     

    perhaps using:

    $get_id = mysqli_fetch_assoc($myConnection,$login_check);
            $_SESSION['uid'] = $get_id['id'];
            header("Location: main.php");
    

    or something to this extent?

  15. I changed everything to mysqli, added the 2nd parameters required by mysqli and fixed the mysql_error(). Everything works now but still re-directs back to the index as if I wasnt logged in.

     

    checklogin.php

    <?php
    error_reporting(E_ALL);
    include("functions.php");
    ob_start();
    $host="########"; // Host name 
    $username="########"; // Mysql username 
    $password="########"; // Mysql password 
    $db_name="########"; // Database name 
    $tbl_name="########"; // Table name 
    
    // Connect to server and select databse.
    mysqli_connect("$host", "$username", "$password")or die(mysqli_error($myConnection));
    mysqli_select_db($myConnection,"$db_name")or die(mysqli_error($myConnection));
    
    // Define $myusername and $mypassword 
    $myusername=$_POST['username']; 
    $mypassword=$_POST['password']; 
    
    // To protect MySQL injection (more detail about MySQL injection)
    $myusername = stripslashes($myusername);
    $mypassword = stripslashes($mypassword);
    $myusername = mysqli_real_escape_string($myConnection,$myusername);
    $mypassword = mysqli_real_escape_string($myConnection,$mypassword);
    $sql="SELECT `id` FROM `user` WHERE `username`='$myusername' AND `password`='".md5($mypassword)."' limit 1";
    $result=mysqli_query($myConnection,$sql);
    
    // Mysql_num_row is counting table row
    $count=mysqli_num_rows($result);
    
    // If result matched $myusername and $mypassword, table row must be 1 row
    if($count==1){
    
    // Register $myusername, $mypassword and redirect to file "main.php"
    header("location:main.php");
    }
    else {
    echo "Wrong Username or Password";
    }
    ob_end_flush();
    ?>
    

    safe.php

    <?php
    
    $stats_get = mysql_query($myConnection,"SELECT * FROM `stats` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection));
    $stats = mysql_fetch_assoc($stats_get);
    
    $unit_get = mysql_query($myConnection,"SELECT * FROM `unit` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection));
    $unit = mysql_fetch_assoc($unit_get);
    
    $user_get = mysql_query($myConnection,"SELECT * FROM `user` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection));
    $user = mysql_fetch_assoc($user_get);
    
    $user_get = mysql_query($myConnection,"SELECT * FROM `structure` WHERE `id`='".$_SESSION['uid']."'") or die(mysqli_error($myConnection));
    $user = mysqli_fetch_assoc($myConnection,$user_get);
    
    
    ?>
    

    do you need to see my index (where the login form is?)

     

    main.php (what should display if logged in)

    <?php 
    error_reporting(E_ALL);
    session_start();
    include("functions.php");
    if(!isset($_SESSION['uid'])){
        $url = '/Template/index.html';
        		echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
    }else{
        include("safe.php");
        
    ?>
    
    <html>
    <meta charset="utf-8">
    <title>Aurora</title>
    <link href="../style.css" rel="stylesheet" type="text/css">
    </head>
    
    <body>
    <div style="position: relative" id="wrapper">
      <!-- Menu Panel End -->
      <div id="mainheader">
    
    </div>
      <?php include("statbar.php"); ?>
    <div id="sidebar">
      <h3>Navigation</h3>
    <?php include("ingamenav.php");?>
    <h3>Account</h3>
      <div id="login" class="login"><center><form action="checklogin.php" method="post">
        Username:<br> <input name="username" type="text" class="tb1" maxlength="24"><br />
        Password:<br> <input class ="tb1" type="password" name="password"/><br />
        <input class="tb1" type="submit" name="login" value="Login"/>
        </form></center>
      <p><a href="#">Forgot Password</a><br>
      <a href="#">Register</a><br></p>
       </div>
      
    <h3></h3>
    <div class="banners">
    Reserved for banners
    </div>
      
    </div>
    
    <div id="content_area">
      <h1>Command Center<span></span></h1>
     <p>The Command Center gives you get a detailed inventory of your resources, military, and the status of your outpost's population.</p>
    <div style="position: relative">
    <table id="stattable" width="600">
      <tr>
        <th BGCOLOR="#660000" colspan="2" scope="row">Resources</th>
      </tr>
      <tr>
        <th scope="row">Credits</th>
        <th scope="row"><?php echo $user['credits']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Networth</th>
        <th scope="row"><?php echo $user['networth']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Turns</th>
        <th scope="row"><?php echo $user['turns']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Energy</th>
        <th scope="row"><?php echo $user['energy']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Biozene Gas</th>
        <th scope="row"><?php echo $user['gas']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Ore</th>
        <th scope="row"><?php echo $user['ore']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Food</th>
        <th scope="row"><?php echo $user['food']; ?>#</th>
      </tr>
      <tr>
        <th width="294" scope="row">Land</th>
        <th width="294" scope="row"><?php echo $user['land']; ?>#</th>
      </tr>
      <tr>
        <th BGCOLOR="#660000" colspan="2" scope="row">Your Populous</th>
      </tr>
      <tr>
        <th scope="row">Population</th>
        <th scope="row"><?php echo $user['population']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Loyalty</th>
        <th scope="row"><?php echo $user['loyalty']; ?>#</th>
      </tr>
      <tr>
        <th BGCOLOR="#660000" colspan="2" scope="row">Your Military</th>
      </tr>
      <tr>
        <th scope="row">Trainees</th>
        <th scope="row"><?php echo $user['population']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Prisoners of War</th>
        <th scope="row"><?php echo $user['prisoner']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Juggernauts</th>
        <th scope="row"><?php echo $user['juggernaut']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Infantry</th>
        <th scope="row"><?php echo $user['infantry']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Marauders</th>
        <th scope="row"><?php echo $user['marauder']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Recon Squads</th>
        <th scope="row"><?php echo $user['reconsq']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Terminator</th>
        <th scope="row"><?php echo $user['terminator']; ?>#</th>
      </tr>
      <tr>
        <th scope="row">Destroyers</th>
        <th scope="row"><?php echo $user['destroyer']; ?>#</th>
      </tr>
      </table>
    </div>
    <!--Table of Contents End -->
    
    </div><!--Content Area End -->
    
    <div id="footer">
    <p>All Rights Reserved © 2014 <a href="#">Aurora Game</a></p>
    </div><!--Footer End -->
    
    </div><!-- Wrapper End -->
    </body>
    </html>
    }
    <?php }
    
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.