0

( ! ) 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");
}
?>
5
Contributors
11
Replies
16
Views
4 Years
Discussion Span
Last Post by rotten69
Featured Replies
  • **@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? Read More

  • 1

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

2

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.

3

@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?

Votes + Comments
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"

1

@godslove

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

0

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");
}
?>

"

0

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

0

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

0

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

0

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

if(isset($_SESSION['username']) ){
    do something;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.