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 8625911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:53:30+00:00 2026-06-12T07:53:30+00:00

I have just had a very weird thing happen; I had my login script

  • 0

I have just had a very weird thing happen; I had my login script working fine on my computer. I just re-uploaded all my databases and my new site to my new test server with my hosting. However when I go to login and when I press submit, it just displays the username and password at the top as if I am var_dump to them.

Is there any reason for this?

This is what shows

string(3) "s17" string(32) "PASSWORD HASH HERE"

Thanks for any and all help.

EDIT. Sorry heres my code, its a bit long, i know your going to say why am i using the old mysql_* stuff but i will be moving to PDO soon, i am learning it at the moment.

<?php

// Start Session to enable creating the session variables below when they log in
session_start();
// Force script errors and warnings to show on page in case php.ini file is set to not display them
//error_reporting(E_ALL);
//ini_set('display_errors', '1');
//-----------------------------------------------------------------------------------------------------------------------------------
// Initialize some vars


include 'connect_to_mysql.php';


    $var_error="";  
    if (isset($_SESSION['error'])) {

         $var_error = $_SESSION['error'];
        unset($_SESSION['error']);
        $error_check_tok = "error_overlay();";

    }else{
            unset($_SESSION['error']);

    }




$login_username = '';
$login_password = '';
if (isset($_POST['login_submit'])) {

    $login_username = $_POST['login_username'];
    $login_password = $_POST['login_password'];

    $login_username = stripslashes($login_username);
    $login_password = stripslashes($login_password);

    $login_username = strip_tags($login_username);
    $login_password = strip_tags($login_password);



    // error handling conditional checks go here
    if ((!$login_username) || (!$login_password)) { 

       $reg_error = "you did not enter both Username and Password, Please try again.";
       $_SESSION['error'] = $reg_error;
       header("Location: index.php");

    } else { // Error handling is complete so process the info if no errors
        include 'connect_to_mysql.php'; // Connect to the database

        $login_username = mysql_real_escape_string($login_username); // After we connect, we secure the string before adding to query
        $login_password = mysql_real_escape_string($login_password); // After we connect, we secure the string before adding to query

        $login_password = md5($login_password); // Add MD5 Hash to the password variable they supplied after filtering it
        var_dump($login_username);
        var_dump($login_password);
        // Make the SQL query
        $sql_users = mysql_query("SELECT * FROM users WHERE username='$login_username' AND password='$login_password' AND account_activated='1'", $general); 
        $login_check = mysql_num_rows($sql_users);
        // If login check number is greater than 0 (meaning they do exist and are activated)
        if($login_check >= 1){ 
                while($row_users = mysql_fetch_array($sql_users)){

                    // Pleae note: Adam removed all of the session_register() functions cuz they were deprecated and
                    // he made the scripts to where they operate universally the same on all modern PHP versions(PHP 4.0  thru 5.3+)
                    // Create session var for their raw id
                    $user_id = $row_users["user_id"];   
                    $user_no_of_logins = $row_users["no_of_logins"];
                    $user_online = $row_users["online"];

                    $_SESSION['user_id'] = $user_id;
                    // Create the idx session var
                    $_SESSION['idx'] = base64_encode("g4p3h9xfn8sq03hs2234$id");
                    // Create session var for their username
                    $login_username = $row["login_username"];
                    $_SESSION['login_username'] = $login_username;
                    // Create session var for their password
                    $login_userpass = $row["login_password"];
                    $_SESSION['login_userpass'] = $login_userpass;


                    //$sql_login_check = mysql_num_rows($sql_login);
                    if($user_no_of_logins == "0"){

                        mysql_query("UPDATE users SET first_login=now() WHERE user_id='$user_id' LIMIT 1", $general);

                    }

                    if($user_online == "0"){

                       mysql_query("UPDATE users SET online = '1' WHERE user_id='$user_id' LIMIT 1", $general); 
                       mysql_query("UPDATE system SET no_online = no_online + 1", $system);
                    }


                    mysql_query("UPDATE users SET last_login=now() WHERE user_id='$user_id' LIMIT 1", $general);  
                    mysql_query("UPDATE users SET no_of_logins = no_of_logins + 1 WHERE user_id='$user_id' LIMIT 1", $general); 
                    mysql_query("UPDATE system SET total_logins = total_logins + 1", $system);




                } // close while

                // Remember Me Section
                if(isset($_POST['login_remember'])) { 
                     $encryptedID = base64_encode("g4enm2c0c4y3dn3727553$user_id");
                     setcookie("idCookie", $encryptedID, time()+60*60*24*100, "/"); // Cookie set to expire in about 30 days
                     setcookie("passCookie", $login_password, time()+60*60*24*100, "/"); // Cookie set to expire in about 30 days

                }

                // All good they are logged in, send them to homepage then exit script
                header("Location: overview.php");

        } else { // Run this code if login_check is equal to 0 meaning they do not exist
            $reg_error = "Login Inputs Incorrect, Please try again.";
            $_SESSION['error'] = $reg_error;
            header("Location: index.php");
        }


    } // Close else after error checks

} 

?>
  • 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-12T07:53:31+00:00Added an answer on June 12, 2026 at 7:53 am

    Well, it’s right there:

    <blink>
               vvvvvvvvvvvvvvvvvvvvvvvvvv
    ---------> var_dump($login_username); <---------
    ---------> var_dump($login_password); <---------
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
                                            </blink>
    

    The reason this was not showing up on another system is likely that the output was buffered on that system. On the new system the output is not buffered so the above is output, and your redirect header is not. For why that is, read https://stackoverflow.com/a/8028987/476.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just had a very long tech support call because a customer didn't have
I just had a very interesting experience with AOP in C#. I have a
I have a very weird problem with my download script it basically 1.gets a
I have just had a brain block, I have a Deck object and want
I have just migrated to mysql 5.5.20 and I had a performance issue with
Just have read sass changelog and found out that FSSM (the gem that had
I have a project hosted with git. I just recently had to reinstall ubuntu,
I had assume I could just do this, but I don't have a way
I have just started using RSpec and I copied the very simple test on
I have just started to learn the very basics of Java programming. Using a

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.