classes help?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

classes help?

Post by shiznatix »

ok i have a class called ajMysqlConnect in a file called mysql.inc.php and i extend the class with another file like this

Code: Select all

require('mysql.inc.php');

class ajValidateUser extends ajMysqlConnect
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

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'];
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?
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

what version of php are you using at I believe it has changed between 4.x.x and version 5.x.x
Post Reply