473,394 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Problems due to PHP version change

Hi,

I have just uploaded an older PHP project I have written by myself up to my
new webserver. On this server PHP is running in version 4.3.2 and this seems
to result in some trouble, since the project worked out pretty fine some
weeks ago under PHP 4.2.3 (I think).
My suggestion is that it has to do sth. with sessionhandling, but I am not
sure.

I don't think that the DB connection is responsible for the problems and I
have already checked that register_globals is switched on.

I always get the message "Das von Ihnen eingegebene Login oder Passwort ist
inkorrekt".

Here the source:

<?
// Init session handling
session_start();

// Include settings files
include("./config/config_db_design.inc.php");

// Include DB functionality
include("./db.php");

// Connect to DB via DB class
$DB = new DB;
$DB->init();

// Booleans needed for login process
$login_entered = true;
$password_entered = true;

$error_message = "";

// Check whether form has already been sent
if (isset($_POST['submit']))
{
// If no menu function has been called, continue with login process
if ( !(isset($_POST['action'])) )
{
// Check for empty user name
if(!$_POST[$users_user_login] || $_POST[$users_user_login] == "")
{
$login_entered = false;
$error_message_1 = "Sie haben keinen Benutzernamen angegeben.";
}

// Check for empty password
if(!$_POST['password'] || $_POST['password'] == "")
{
$password_entered = false;
$error_message_2 = "Sie haben kein Passwort angegeben.";
}

if ($login_entered && $password_entered)
{
// Retrieve correct dataset
$password = md5($password);

$data = $DB->select("SELECT * FROM $table_users WHERE
$users_user_login='$login' AND $users_user_password='$password'");
$count = count($data);

if ($count == 1)
{
// Store session variables
$logged_in_user_id = $data[0][$users_user_id];
$password = $data[0][$users_user_password];
$nachname = $data[0][$users_user_nachname];
$vorname = $data[0][$users_user_vorname];
$email = $data[0][$users_user_email];
$status = $data[0][$users_user_status];

session_register('logged_in_user_id');
session_register('password');
session_register('nachname');
session_register('vorname');
session_register('email');
session_register('status');

header("location:main.php");
}
else
{
$error_message_3 = "Das von Ihnen eingegebene Login und oder Passwort ist
inkorrekt.";
}
}
}
}

// Check whether password reset function has been invoked
if (isset($_POST['submit2']))
{
// Retrieve correct dataset
$data = $DB->select("SELECT * FROM $table_users WHERE
$users_user_email='$email'");
$count = count($data);

if ($count == 1)
{
// Set mail address and determine user id for updating
$user_id = $data[0][$users_user_id];
$mail_address = $email;

include("./logic/reset.tpl.php");

$error_message_1 = "Die neuen Zugangsdaten wurde Ihnen übermittelt.
<br>Bitte loggen Sie sich nun ein.";
}
else
{
$error_message_1 = "Die von Ihnen angegebene E-Mail Adresse ist inkorrekt.";
$action = "password";
}
}

// Check if some additional menu function has been called
$content_template = "";

if ( strcmp($action,"password") == 0)
{
$content_template = "./index/content_index_password.tpl.php";
}

if ( strcmp($action,"hilfe") == 0)
{
$content_template = "./help/help.tpl.php";
}

if ( strcmp($action,"feature_list") == 0)
{
$content_template = "./index/content_index_feature_list.tpl.php";
}

if ( strcmp($action,"impressum") == 0)
{
$content_template = "./index/content_index_impressum.tpl.php";
}

if ( strcmp($action,"") == 0)
{
$content_template = "./index/content_index.tpl.php";
}

?>

<html>

<head>
<title>Login</title>
<link rel="stylesheet" type="text/css" href="./style1.css">
</head>

<body>

<!-- Layout / Design table -->
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"
cellclass="designtable1_top">
<tr height="15%">
<td colspan="2" class="designtable1_top">
<? include("./layout/include_layout_top.tpl.php"); ?>
</td>
</tr>
<tr height="75%">
<td width="15%" class="designtable1_left">
<? include("./menu_templates/menu_index.tpl.php"); ?>
</td>
<td class="designtable1_main">

<!-- Main content -->
<? include($content_template); ?>

</td>
</tr>
</table>

</body>
</html>

Thanks for your help !


Jul 17 '05 #1
0 1881

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: jblazi | last post by:
I should like to search certain characters in a string and when they are found, I want to replace other characters in other strings that are at the same position (for a very simply mastermind game)...
0
by: Michael Fork | last post by:
Note: I pasted the code the attachments as plain text after the message (I wasn't able to post it with an attachment...) Attached are the XSL and XML files that I am having problems with. I am...
3
by: Bernd Giegerich | last post by:
Hi, we had a strange problem with DB2 8.2 Enterprise Edition on Windows 2003 (Standard) Server. We installed DB2 8.2 (8.1.7) directly on a naked W2K3 system (no migration, no update -> no...
13
by: tshad | last post by:
How do we handle Caching in IE? It seems that my system works fine in Mozilla and Netscape when I make changes. But in IE the changes are not brought across when someone has been to the site...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
0
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
4
by: JM | last post by:
Hi, I am an old programmer who is only just getting back into it after about 10 years, and for the life of me I can not work out what I am doing wrong. Firstly, I've recently downloaded and...
3
by: Russ | last post by:
I have a Web Service that was originally created with .NET VC 2003, and subsequently converted to the 2005 version. It works fine when built as a debug version, and run on the workstation it was...
5
by: Simon | last post by:
I have problem with namespaces. I have a program that consumes the web service and has for instance names space nsProgram. In this program I have defined several classes that I use for storing and...
3
by: Earl Anderson | last post by:
One of the users in our departmental db has Read/Write permissions to a particular form. He was able to access and edit the form at will until 2 weeks ago. His current problem was that he was not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.