classes help?
Posted: Sat Apr 30, 2005 9:45 am
ok i have a class called ajMysqlConnect in a file called mysql.inc.php and i extend the class with another file like this
the file with the extension is called validateUser.inc.php
then i call the class in a do_login.php page, the code for do_login.php
but my classes are not being called properly it seams.
what i want done is when do_login.php is opened it takes the posted username and password and sends them to a class that checks them from a database and that class is a extension of a class that connects to the mysql database. how should i go about doing that?
Code: Select all
require('mysql.inc.php');
class ajValidateUser extends ajMysqlConnectthen i call the class in a do_login.php page, the code for do_login.php
Code: Select all
session_start();
require('inc/validateUser.inc.php');
$validate = new ajValidateUser;
$validate->CheckUserPass($_POST['username'], $_POST['password']);
if ($validate->error && $validate->errorId)
{
'Error: '.$validate->error.'<br>';
'Errror ID: '.$validate->errorId.'<br>';
}
echo 'userid: '.$_SESSION['user_id'];
echo 'username: '.$_SESSION['username'];what i want done is when do_login.php is opened it takes the posted username and password and sends them to a class that checks them from a database and that class is a extension of a class that connects to the mysql database. how should i go about doing that?