Jump to content

Class Not Found


jkewlo

Recommended Posts

Ok here is another problem

 

I am trying to pass the user login to check.php but I keep getting

 

 

Fatal error: Class 'checkUser' not found in /var/www/www.eve-lounge.com/htdocs/v2/check.php on line 6

 

the class checkUser() exist within the function.class.php

 

Its driving me nuts any help would be wonderful.

 

which has

 

<?php
session_start();
require_once('data/function.class.php');

// Next, create an instance of the class
$newCheck = new checkUser;

// Call the registerUser() method, passing in the required variables
$newCheck->checkUser($username, $password);

?>

Link to comment
Share on other sites

You would need to post data/function.class.php for anyone here to be able to tell you why the class cannot be found.

 

My guesses would be either: short open tags, a spelling error, more than one function.class.php at different paths and the one being used is not the one with the class definition in it.

Link to comment
Share on other sites

The best practice is to keep classes in their own php file, named with the same name as the class.  This also facilitates simple autoloading, if that idea appeals to you, and for the price of a bit of overhead, you won't have to worry about manually requiring class files. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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