Jump to content

Class Not Found When Extending


Pain

Recommended Posts

Hello again. I am trying to extend a class, but it gives me an error:

Fatal error: Class 'Redirection' not found in /home/searchqu/public_html/game/class.session_destroy.php on line 3

 

 

Im trying to extend the logout class:

<?php
session_start();
class SessionDestroy extends Redirection{

public function destroy_session() {

session_destroy();

Redirection::redirect("login");

}


}

?>

 

this is my redirection class:


<?php


class Redirection {

function redirect($parameter) {

header("Location: $parameter");

}

}

?>

 

and this is my actual logout page:


<?php
ob_start();
require('class.session_destroy.php');
require('class.redirect.php');

$logout = new SessionDestroy;
$redirect = new Redirection;
$logout->destroy_session();
ob_end_flush();
?>

 

What could be the problem here? Thanks:]

Link to comment
Share on other sites

The way you are calling the the classes through includes, and the fact that each class basicly performs a single line of code, yeah, procedural would make more sense to me. It's just my point of view, there are others about that would tell you to even allow the word procedural to enter your mind unbidden is punnishable by 3 lashes and 4 hail Marys.

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.