Jump to content

Error Message with Sessions


Fearpig

Recommended Posts

Hi Guys,

I am getting the following error when I try and use my login script, would someone take a look at this and suggest where I'm going wrong.....

 

Error:  :o

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

 

Login.php

<?php
include '../Connect_Product_Database.php';

$Password = $_POST['Password'];
$Username = $_POST['Username'];

//check that the user is calling the page from the login form and not accessing it directly 
//and redirect back to the login form if necessary 
if (!isset($Username) || !isset($Password)) { 
header( "Location: http://fer-post/internet/site_upload/" ); 
} 
//check that the form fields are not empty, and redirect back to the login page if they are 
elseif (empty($Username) || empty($Password)) { 
header( "Location: http://fer-post/internet/site_upload/" ); 
} 

//convert the field values to simple variables 
//add slashes to the username and md5() the password 
$Slash_User = addslashes($_POST['Username']); 
$MD5_Pass = md5($_POST['Password']); 


$sql="SELECT * FROM tbl_Users WHERE Username='$Slash_User'";
$Details=odbc_exec($conn,$sql);
if (!$Details)
       {exit("Error in SQL - User not found");}

$Stored_Password=odbc_result($Details,"Password");

if ($MD5_Pass == $Stored_Password) {


//----------Technical Logon----------
if ($Slash_User == 'technical') {

	//Starts a session and registers a variable
	session_start(); 
	session_register('Slash_User'); 

	include '../Navigation.php';	
	echo "<p class=BodyText1 align=center>Edit technical stuff!</p>";
	echo "<div  align=center><form action='Technical_Edit_Products.php' method='post'><input name='submit' type='submit' value='Edit Product Details'></form></div><br>";


//----------Training Logon----------		
}elseif($Slash_User == 'training'){

	//Starts a session and registers a variable
	session_start(); 
	session_register('Slash_User'); 

	echo "<p class=BodyText1 align=center>edit training stuff</p>";


//----------No Recognised User----------		
}else{

	include '../Navigation.php';
	echo "<p class=BodyText1 align=center>User not configured - Report this to IT.</p>";
	}


//----------No Recognised Password----------	
}else{

include '../Navigation.php';
echo "<p class=BodyText1 align=center>Password Not OK</p>";

}


?> 

 

If anyone could suggest whats causing this then I'd appreciate it!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.