functions.php
Code: Select all
<?
// start session
session_start();
// include files
require "includes/sql.php";
// get action to do
$id = $_GET['id'];
// if ID is LOGIN
if($id=="login") {
$user = $_POST['username'];
$pass = $_POST['password'];
$open = new Connection;
$open->connect();
$c = $open->$c;
$db = $open->$db;
$q = "select * from 'members' where rank = 'admin' and username = '$user' and password = '$pass'";
$r = mysql_query($q, $c);
$rows = mysql_num_rows($r);
if($r>1) {
echo "Sorry, there was more than one result returned";
} else {
session_register("user");
header("Location: admin.php");
}
}
?>Code: Select all
<?
class Variables {
var $host = "localhost";
var $db = "newezone_site";
var $user = "newezone_xxxx";
var $pass = "xxxx";
}
class Connection extends Variables {
function connect() {
var $c = mysql_connect("$this->host", "$this->user", "$this->pass");
var $db = mysql_select_db("$this->db", "$this->$c");
}
function Close() {
mysql_close("$this->c");
}
}
?>-NayParse error: parse error in /home/newezone/public_html/admin/includes/sql.php on line 16
Fatal error: Cannot instantiate non-existent class: connection in /home/newezone/public_html/admin/functions.php on line 22