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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:26:40+00:00 2026-06-16T01:26:40+00:00

error_reporting(E_ALL); session_start(); var_dump($_SESSION[‘user’]); require ‘config/database.php’; var_dump($_SESSION[‘user’]); i have problem because i lose session after

  • 0
error_reporting(E_ALL);
session_start();
var_dump($_SESSION['user']);
require 'config/database.php';    
var_dump($_SESSION['user']);

i have problem because i lose session after include databse.php file…

database.php

$user = "xxx";
$password = "xxx";
$database = "xxx";
$server = '98.x.x.126';

mysql_connect($server, $user, $password);
mysql_select_db($database);

PHP ver: 5.2.17, shared server. on my local server which is 5.3 and 5.4 is working perfectly.

Update: i don’t lose the session totally just the user value is changed to database name?

Update2:

var_dump($_SESSION['user']);
$user = "denes_lucky";
var_dump($_SESSION['user']);
$password = "123456X3M";
var_dump($_SESSION['user']);
$database = "denes_lucky";
var_dump($_SESSION['user']);
$server = '98.130.0.126';
var_dump($_SESSION['user']);

mysql_connect($server, $user, $password);
var_dump($_SESSION['user']);
mysql_select_db($database);
var_dump($_SESSION['user']);

the problem is after $user = “xxx”;

  • 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-16T01:26:41+00:00Added an answer on June 16, 2026 at 1:26 am

    Turn off register_globals in your php.ini or in .htaccess

    When they are turned on – assigning $user = 'foo'; also modified the contents of $_SESSION['user'] variable.

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

Sidebar

Related Questions

Here is the config.php file <?php error_reporting(E_ALL ^ E_NOTICE); /*=========== Database Configuraiton ==========*/ $db_host
I have the following code: <?php ini_set('display_errors', 'On');error_reporting(E_ALL | E_STRICT); session_start(); set_include_path('../include'); if(isset($_GET[lang]) &&
I have A.php and B.php A.php <?php error_reporting(E_ALL); ini_set(display_errors,1); class myClass { function hello()
Right now I have this code. <?php error_reporting(E_ALL); require_once('content_config.php'); function callback($buffer) { // replace
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN> <?php include('db_connection.php'); error_reporting(E_ALL); session_start(); ?> <html> <head>
<?php ini_set('display_errors',1); error_reporting(E_ALL); session_start(); $targ_w = $targ_h = 150; $jpeg_quality = 90; $ext=$_GET['ext']; $src
On page test.php i send form with method post. Сode page test.php var_dump($_POST); error_reporting(E_ALL
This is my login.php <form action=index.php method=get> <?php error_reporting(E_ALL & ~E_NOTICE); ?> <?php session_start();
I have this script which i use on my own website: <?php error_reporting(E_ALL); $email_subject
I have the following structure otsg > class > authentication.php > database.php > user.php

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.