Jump to content

Not Working :S


Dethman

Recommended Posts

Not sure why its doing this Here is the main-functions.php file:

 

<?php
//
/// FUNCTION SYSTEM!
//

function getSystemInfo($ID){
$q="SELECT * FROM `SystemInfo` WHERE `ID`='{$ID}'";
$v=mysql_query($q);
$r=mysql_fetch_array($v);
return $r;
}
?>

 

Here is the Login and Display Page:

 

<?php
require("db_connect.php");
require("functions/main-functions.php");
//login function
if( isset($_POST['Submit']) ){
$username = $_POST['uname'];
$password = $_POST['psword'];
if( empty($username) ){
	$message = "Login information incorrect!";
} 
else if( mysql_num_rows(mysql_query("SELECT `userid` FROM `user_users` WHERE `username`='$username'")) == 0 ){
	$message = "Login information incorrect!";
}
else if( empty($password) ){
	$message = "Login information incorrect!";
} else {
	$encpass = md5($password);
	$sql = mysql_query("SELECT * FROM `admin_users` WHERE `username`='$username'");
	$userstuff = mysql_fetch_array($sql);

	if( $userstuff['password'] == $encpass ){
		$_SESSION['userid'] = $userstuff['userid'];
		//echo "Login successful.<br><a href=\"index.php\">Index</a>";
		//exit();
		header("Location: admin.php?page=main");
		}else{
		$message = "Incorrect Password";
		}
	}
}

//end login function
if( isset($_SESSION['userid']) ){
$userid = $_SESSION['userid'];
$timenow=date('Y-m-d');
$servertime=date('h:i:s');
$q=("UPDATE `user_users` SET `lastlogin`='$timenow $servertime'");
mysql_query($q);
header("Location: admin.php?page=main");
} else {

}
$sys_id=1;
$System=getSystemInfo($sys_id);
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?echo($System['Business_Name']);?> :: <?echo($System['Business_Info']);?></title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- header -->
    <div id="header">
    <div id="menu">
       <div id="menu_list"> 
        <a href="#">Home</a>
        <img src="images/splitter.gif" class="splitter" alt="" />
        <a href="#">About Us</a>
        <img src="images/splitter.gif" class="splitter" alt="" />
        <a href="#">Services</a>
        <img src="images/splitter.gif" class="splitter" alt="" />
        <a href="#">Pricing</a>
        <img src="images/splitter.gif" class="splitter" alt="" />
        <a href="#">Contacts</a>
        </div>
    </div>
</div>
      <div id="logo">
      <div id="logo_text">
      <a href="#"><?echo($System['Business_Name']);?></a>
      <br/><br/>
      <?echo($System['Business_Type']);?>
</div>
    </div>
    <!--end header -->
    <!-- main -->
    <div id="main">
          <div id="sidebar">
          	<h1>Lorem Ipsum</h1>
            <div class="item"><a href="#"><img src="images/picture.jpg" alt=" " /></a>
            <span class="description">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus ornare condimentum.</span>            </div>
            <div class="item"><a href="#"><img src="images/picture.jpg" alt=" " /></a>
           	<span class="description">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus ornare condimentum.</span>            </div>
           
          </div>
                          <h1>Welcome</h1>
                <p><strong>Oceanic 110</strong> is a free template released by <a href="http://www.nimbusgames-llc.com">NimbusGames,llc</a> which means you can use it in any way you want provided you keep the link to the author intact.</p>
                <ul>
                  <li>Lorem ipsum dolor sit amet.</li>
                  <li>Consectetuer adipiscing elit.</li>
                  <li>Maecenas ac lacus. Etiam quis ante.</li>
                  <li>Nullam accumsan metus sit amet est.</li>
                  <li>Nullam diam. Nunc ac ipsum at nisl pretium congue.</li>
                </ul>
                <h1>Lorem ipsum dolor</h1>
                <p><strong>Lorem ipsum</strong> dolor sit amet, consectetuer adipiscing elit. Phasellus ornare condimentum sem. Nullam a eros. Vivamus vestibulum hendrerit arcu. Integer a orci. Morbi nonummy semper est. Donec at risus sed velit porta dictum. Maecenas condimentum orci aliquam nunc. Morbi nonummy tellus in nibh. Suspendisse orci eros, dapibus at, ultrices at, egestas ac, tortor. Suspendisse fringilla est id erat. Praesent et libero. Proin nisi felis, euismod a, tempus varius, elementum vel, nisl. Fusce non magna sit amet enim suscipit feugiat. Fusce et leo.</p>
                <p><strong>Hello and Welcome</strong> To the <a href="http://www.nimbusgames-llc.com">NimbusGames,llc</a> Made          Admins Panel Below you can login and edit/remove/add things on the website.</p>
                <p><form method="post" action="login.php">
Username:<input type="text" name="usname">
Password:<input type="password" name="passwrd">
<input type="submit" value="LOGIN"> 
</form></p>
<p class="additional"></p>
          </div>
    </div>
    <!-- end main -->
    <!-- footer -->
    <div id="footer">
    <div id="left_footer">© Copyright 2008 <b>NimbusGames,llc</b></div>
    <div id="right_footer">

<!-- Please do not change or delete this link. Read the license! Thanks. :-) -->
Design by <a href="http://www.nimbusgames-llc.com" title="Website Design"><strong>NimbusGames,llc</strong></a>

    </div>
</div>
    <!-- end footer -->
</body>
</html>

 

 

Ok the problem is that where it says $System['Business_Name'] and everything like it refuses to Display what is in the table I use this exact same code on a game of mine but it works but the $System var in the game is being called like this:

<?php
if(isset($_SESSION['userid'])){$System=getSystemInfo();}
?>

 

But this website dosnt use any Sessions other than SESSION_START in the DB_CONNECT FILE below:

 

<?php
session_start() or DIE("A session could not be created! Please Contact the administrator");;
mysql_connect('localhost', 'psionic', '1627RE@&!^') or DIE("UNABLE TO CONNECT TO DATABASE! Please Contact the administrator");
mysql_select_db('psionic_Chip') or DIE("UNABLE TO SELECT THE DATABASE! Please Contact the administrator");
?>

 

 

Anyone want to help this is driving me nuts :S

 

 

Thank you and please hurry,

 

Brian Flores AKA Dethman CEO,

NimbusGames,llc!

 

 

Link to comment
https://forums.phpfreaks.com/topic/116946-not-working-s/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.