( ! ) SCREAM: Error suppression ignored for
( ! ) Fatal error: Call to undefined function session_is_registered() in C:\wamp\www\attendance\include\checksession.php on line 3
Call Stack

Time Memory Function Location

1 0.0010 183576 {main}( ) ..\admin.php:0
2 0.0015 185696 include_once( 'C:\wamp\www\attendance\include\checksession.php' ) ..\admin.php:3

<?php session_start();

if( !session_is_registered("ulogin"))
{
        header("Location:login.php?invalid=2");
}
if( !session_is_registered("utype"))
{
        header("Location:login.php?invalid=2");
}
?>

Recommended Answers

All 11 Replies

Apparently, you don't have a function called session_is_registered.In the case that it is defined in another file in the same directory, then add this line in the top of the page

include("YourFileName.php");

I hope this helps.

Member Avatar for LastMitch

@godslove

What PHP version are you using?

session_is_registered() - You can't used the same function, it only works once.

Try this:

<?php
session_start();
if (!session_is_registered(ulogin)) {
    header("Location: login.php");
    die();
}
?>

what error appears?

commented: To Rectify what some retard did to LastMitch +0

LastMitch - "( ! ) SCREAM: Error suppression ignored for
( ! ) Fatal error: Call to undefined function session_is_registered() in C:\wamp\www\attendance\include\checksession.php on line 3"

@godslove

I tried using your codes by replacing header() with a basic echo statement, and it work fine.

lps - "Fatal error: Call to undefined function session_is_registered() in C:\xampp\htdocs\celine\attendance\include\checksession.php on line 2

<?php session_start();
if( !session_is_registered("ulogin"))
{
        echo("Location:login.php?invalid=2");
}
if( !session_is_registered("utype"))
{
        echo("Location:login.php?invalid=2");
}
?>

"

attendance management system ~

If you are using PHP 5.4.0 then this function is no longer available.

@pritaeas - yes sir thank you ,im using that version, how can i replace it?

pritaeas -Thank you ~ i already figure out -instead of using session_is_registered , i used $_session.

@godslove
suggest you to use isset($_session) to do it. As without isset(), it return false if the variable is set to 0.

I previously thought you were defining a custom method. I'd go with the following code.

if(isset($_SESSION['username']) ){
    do something;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.