grrrrr now thats fixed i am getting these errors:
Notice: Undefined variable: userinfo in c:\apache\apache\htdocs\starbound\engine.php on line 44
Notice: Undefined variable: userinfo in c:\apache\apache\htdocs\starbound\engine.php on line 45
Notice: Undefined variable: userinfo in c:\apache\apache\htdocs\starbound\engine.php on line 45
Notice: Undefined variable: userinfo in c:\apache\apache\htdocs\starbound\engine.php on line 47
Notice: Undefined variable: userinfo in c:\apache\apache\htdocs\starbound\engine.php on line 48
Notice: Undefined variable: program in c:\apache\apache\htdocs\starbound\engine.php on line 56
Notice: Undefined variable: userinfo in c:\apache\apache\htdocs\starbound\engine.php on line 57
Notice: Undefined variable: userinfo in c:\apache\apache\htdocs\starbound\engine.php on line 58
Notice: Undefined variable: userinfo in c:\apache\apache\htdocs\starbound\engine.php on line 59
Notice: Undefined variable: userinfo in c:\apache\apache\htdocs\starbound\engine.php on line 60
Below are the files involved.
OVERVIEW.PHP
<?php
global $userinfo;
$page = "Overview";
$program = "<table border= 'center'><tr><td align center>Welcome to Star Bound </td></tr></table>";
session_start();
include 'engine.php';
?>
<html>
<head>
<?php echo "<title>Browsing {$page} on Star Bound. Current Round is {$round} </title>"; ?>
</head>
<body>
<?php
main(); ?>
</body>
</html>
ENGINE.PHP:
<?php
/ Star Bound Engine Program, please consult Skeleton before editing this file. /
$time = time("D/j/M/y/H/i/s/a");
include'lord.php';
$connection = mysql_connect($host,$user,$password)
or die(mysql_error());
$db = mysql_select_db($database,$connection)
or die(mysql_error());
/ Gets userinfo /
$getuserinfoquery = "select from userinfo where username = '".$_SESSION['username']."'";
$userinfoquery = mysql_query($getuserinfoquery)
or die (mysql_error());
$userinfo = mysql_fetch_array($userinfoquery,MYSQL_ASSOC);
/gets round data */
$getroundquery = "select round from game";
$roundquery = mysql_query($getroundquery)
or die ($error);
$round = mysql_fetch_array($roundquery,MYSQL_ASSOC);
extract($round);
/ gets message data /
$getmessageinfoquery = "select * from messages where recipitentusername = '".$_SESSION['username']."'";
$messagesquery = mysql_query($getmessageinfoquery)
or die(mysql_error());
$messages = mysql_fetch_array($messagesquery,MYSQL_ASSOC);
/ Gets galaxies Data /
$getgalaxiesquery = "select from galaxies";
$galaxiesquery = mysql_query($getgalaxiesquery)
/40*/ or die(mysql_error());
$galaxies = mysql_fetch_array($galaxiesquery,MYSQL_ASSOC);
function main()
{
echo "<table width = '770' border = '1'>
<tr>
<td>Credits:{$userinfo["credits"]}</td>
<td>Power:{$userinfo["power"]}</td><td>Metal:{$userinfo["metal"]}</td>
<td>Plutonium:{$userinfo["plutonium"]}</td>
<td>Networth:{$userinfo["networth"]}</td>
</tr>
<tr>
<td><tr><td width=\"150\" align= \"center\" bgcolor= \"#cccccc\">
Main</td>
<td valign= 'top' colspan= '3' rowspan= '30'>{$program}l</td><td align='left' valign='top' rowspan= '20'>
Your Empire id is: {$userinfo["userid"]}
<br>Your Empire Name is: {$userinfo["username"]}
<br>Your Empire is in Galaxy {$userinfo["galaxy"]}
<br>Your empire has a defence of {$userinfo["defence"]}
</td>
<td colspan= \"6\" rowspan= \"20\"></td></tr>
<tr><td align= \"center\"><a href=\"overview.php\">Overview</a></td></tr>
<tr><td align= \"center\"><a href= \"status.php\">Status</a></tr>
<tr><td align= \"center\"><a href= \"galacticnavigator.php\">Galactic Navigator</a></tr>
<tr><td align= \"center\"><a href= \"controlcenter.php\">Control Center</a></td></tr>
<tr><td align= \"center\" bgcolor= \"#cccccc\">Military</td></tr>
<tr><td align= \"center\"><a href= \"buildings.php\">Buildings</a></td></tr>
<tr><td align= \"center\"><a href= \"shipbuildselect.php\">Construct A Ship</a></tr>
<tr><td align= \"center\"><a href=\"shipoverview.php\">Ship Overview</a></td></tr>
<tr><td align= \"center\"><a href=\"controllers.php\">Controllers</a></td></tr>
<tr><td align= \"center\" bgcolor= \"#cccccc\">Galactic Data</td></tr>
<tr><td align= \"center\"><a href= \"galacticsenate.php\">Galactic Senate</a></td></tr>
<tr><td align= \"center\"><a href= \"galacticdata.php\">Galactic Data</a></td></tr>
<tr><td align= \"center\"><a href= \"galaxyforums.php\">Galaxy Forums</a></td></tr>
<tr><td align= \"center\"><a href= \"galaxycontrol\">Galaxy Control</a></td></tr>
<tr><td align= \"center\"><a href= \"galaxynews.php\">Galaxy News</a></td></tr>
<tr><td align= \"center\" bgcolor= \"#cccccc\">Alliance Data</td></tr>
<tr><td align= \"center\"><a href= \"alliancedata.php\">Alliance Data</a></td></tr>
<tr><td align= \"center\"><a href= \"allianceforums.php\">Alliance Forums</a></td></tr>
<tr><td align= \"center\"><a href= \"alliancecommand.php\">Alliance Command</a></td></tr>
<tr><td align= \"center\"><a href= \"alliancenews.php\">Alliance News</a></td></tr>
<tr><td align= \"center\" bgcolor= \"#cccccc\">Attack And Intelligence</td></tr>
<tr><td align= \"center\"><a href= \"probes.php\">Probes</a></td></tr>
<tr><td align= \"center\"><a href= \"attack.php\">Attack</a></td></tr>
<tr><td align= \"center\"><a href= \"defence.php\">Defence</a></td></tr>
<tr><td align= \"center\"><a href= \"invasions.php\">Invasions</a></td></tr>
<tr><td align= \"center\" bgcolor= \"#cccccc\">Messaging</td></tr>
<tr><td align= \"center\"><a href= \"inbox.php\">Inbox</a></td></tr>
<tr><td align= \"center\"><a href= \"newmessage.php\">New Message</a></td></tr>
<tr><td align= \"center\" bgcolor= \"#cccccc\">Star Bound</td></tr>
<tr><td align= \"center\"><a href= \"help.php\">Help</a></td></tr>
<tr><td align= \"center\"><a href= \"usersettings.php\">Settings</a></td></tr>
<tr><td align= \"center\"><a href= \"credits.php\">Credits</a></td></tr>
<tr><td align= \"center\"><a href= \"logout.php\">Logout</a></td></tr></table>
";
}
?>
Login.php:
<?php
session_start();
/ This Page Allows the user to login. Page Incomplete. Form Processor Not active /
$page="Login";
include("lord.php");
$connection = mysql_connect($host,$user,$password)
or die ("could not connect to server, please check which page you are on and post this error on the bug forum. Thank you, the Star Bound Admin Team");
$db = mysql_select_db($database,$connection)
or die ($error);
/Selects round Data - game query slects game data/
$getroundquery = "select round from game";
$roundquery = mysql_query($getroundquery)
or die ($error);
$round = mysql_fetch_array($roundquery);
extract($round);
?>
<html>
<head>
<title>Login into Star Bound <?php echo "$round" ?></title>
</head>
<body>
<table width="770" border= "1">
<tr>
<td align='center'>Quick Links</td>
<td align='center'>Your are on page <?php echo "{$page}. Login into Round {$round} by using the form below";
?>
</td>
</tr>
<tr>
<td align='center'><a href='www.starboundonline.com'>Star Bound Home</a></td>
<td align='left' rowspan='10' valign='top'>
<?php
/ Login Form Generator /
echo "Login:
<form action='logincheck.php' method='post' name='login' id='login'>
<p>Username:
<input name='username' type='text' size='20' maxlength='20'>
</p>
<p>Password:
<input name='password' type='password' size='20' maxlength='20'>
</p>
<p>
<input type='submit' name='Submit' value='Login to Star Bound {$round}'>
</p>
</form>
";
?>
</td>
</tr>
</tr>
<tr>
<td align='center'><a href='help.php'>Help</a></td>
</tr>
</table>
</body>
</html>
logincheck.php
<?php
session_start();
$SESSION['username'] = $POST['username'];
$SESSION['password'] = $POST['password'];
$page = "Checking Log in";
include 'lord.php';
$connection = mysql_connect($host,$user,$password)
or die ("could not connect to server, please check which page you are on and post this error on the bug forum. Thank you, the Star Bound Admin Team");
$db = mysql_select_db($database,$connection)
or die ($error);
$getcheckusernamequery = 'select username from userinfo where username = "'.$SESSION['username'].'" and password = "'.$SESSION['password'].'"';
$checkusernamequery = mysql_query($getcheckusernamequery)
or die("can not read username: ".mysql_error());
$usernamecheck = mysql_num_rows($checkusernamequery);
if ($usernamecheck = 1)
{
$auth="yes";
header("location: [url]http://localhost/starbound/overview.php[/url]");
}
else
{
echo "Username Invalid, please press back and try again";
}
?>
<html>
<head>
<title>Star Bound Signing In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>
Help appreciated