Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:18:58+00:00 2026-06-14T18:18:58+00:00

Possible Duplicate: PHP session side-effect warning with global variables as a source of data

  • 0

Possible Duplicate:
PHP session side-effect warning with global variables as a source of data

I have a problem with a login script that im using. problem is with some of the hosting providers after login the session is not registering. and in php error logs i can see this error

PHP Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0

but in most of the hosting’s like bluehost, hostmonster it works fine without any error. can someone point me out what is the wrong thing im doing here? thank you in advanced.

Code:

<?
session_start();
ob_start();
?>

        <?php
        $err=isset($_GET['error'])?$_GET['error']:""; 
        if($err=='error'){?>
        <div class="errormsgbox">Wrong Username or Password. Please try again.</div>    
        <?php }

        if(!isset($_SESSION['adminuser'])){
        if($_SERVER["REQUEST_METHOD"] == "POST")
        {
        // username and password sent from Form
        $adminuser=mysql_real_escape_string($_POST['adminuser']); 
        $adminpassword=mysql_real_escape_string($_POST['adminpassword']); 
        $gpassword=md5($adminpassword); // Encrypted Password
        $sql="SELECT id FROM admin WHERE adminuser='$adminuser' and adminpassword='$gpassword'";
        $result=mysql_query($sql);
        $count=mysql_num_rows($result);

        // If result matched $username and $password, table row must be 1 row
        if($count==1)
        {

        session_register("adminuser");

        header("location:index.php");
        }
        else
        {
        header("location:login.php?error=error");

        }
        }
        ob_end_flush();

        ?>
    <form action="login.php" method="post">
    <div class="login_input">
    <label class="loginlbl"  for="adminuser">UserName :</label>
    <input type="text" name="adminuser"/>
    </div>
    <div class="login_input">
    <label class="loginlbl"  for="adminpassword">Password :</label>
    <input type="password" name="adminpassword"/>
    </div>
    <div class="login_submit">
    <input type="submit" id="submit" value=" Login to Admin Contol Panel"/>
    </div>
    </form>
    <?php }else{
    header("location:index.php");
    }
    ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:18:59+00:00Added an answer on June 14, 2026 at 6:18 pm

    The use of session_register is deprecated as says in PHP:SESSION_REGISTER

    You should use:

    //session_register("adminuser"); //deprecated
    $_SESSION["adminuser"] = $adminuser;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Extending Session Timeout in PHP I have php sessions where the problem
Possible Duplicate: Can't pass mysqli connection in session in php Many of us have
Possible Duplicate: How do I expire a PHP session after 30 minutes? How to
Possible Duplicate: PHP Get end string on url between / and / I have
Possible Duplicate: php false place in condition I have noticed that a lot of
Possible Duplicate: php loop through associative arrays i have a variable which prints an
Possible Duplicate: How do I expire a PHP session after 30 minutes? I am
Possible Duplicate: Simplest way to profile a PHP script We are building this online
Possible Duplicate: php mail() function on localhost I am using php mail(). I have
Possible Duplicate: PHP call class in class returns error:500 I have code that looks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.