473,698 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with $_SESSION and header("Locatio n:...

Session variables set before a header("Locatio n: whatever") are not
being written.

And yes, before the header() call, I have session_write_c lose() but the
result is the same. This problem is with PHP 4.3.10 on my hosting
providers' server (and obviously I wouldn't like the hassle of changing
hosting providers), but it works OK on some other PHP 4 and PHP 5
servers.

Is there any workaround?

Sep 14 '06 #1
1 2246

he*********@gma il.com wrote:
Session variables set before a header("Locatio n: whatever") are not
being written.

And yes, before the header() call, I have session_write_c lose() but the
result is the same. This problem is with PHP 4.3.10 on my hosting
providers' server (and obviously I wouldn't like the hassle of changing
hosting providers), but it works OK on some other PHP 4 and PHP 5
servers.

Is there any workaround?
Disregard. I'm really stupid. It seems that register globals was left
enabled on this server and the variables in the session were
overwritten by the variables in the script. Why would anyone be so lazy
to use register globals is beyond me....

Sep 14 '06 #2

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

Similar topics

11
6070
by: Francisco Mendez | last post by:
I get the following message when trying to run my script: "Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/newcustomer.php:23) in /var/www/html/newcustomer.php on line 332" ....newcustomer.php:23 is where my script begins, at line 23. before that line, only comments.
13
11802
by: Dave Smithz | last post by:
Hi there, I have a php script that does some form input validation. As it verifies each field if the field has incorrect data, it appends an error message to an $error array. E.g. if (an_error = true) { $errors.="<tr><td>You have note entered a surname. This is mandatory date of birth incorrectly.</td></tr>"; }
6
2365
by: bissatch | last post by:
Hi, I am trying to use the following function: header("Location: http://www.mysite.co.uk/home/update/index.php"); ....but getting the following error: Warning: Cannot modify header information - headers already sent by (output started at
5
3217
by: Duderino82 | last post by:
I'm working on a very simple peace of php where basically there is a form and 3 buttoms. One refreshed the page, one posts the form, and another one (since this form contains values of a record) deletes the record. The sintax is this one: if ($delete) { header ("Location: $redirect?del=$code&table=$tab"); exit; }
3
2182
by: thomasg | last post by:
Hi, I am moving some scripts from a UNIX box to a Windows box. A data entry form calls a PHP script the updates the records from the form. After the script completes, The script redirects to anothe page. No headers have been sent, the script just does the database update. This works on the UNIX account: Header( "Location: http://www.new-url.com" ); It does not work on the IIS box.
2
4124
by: hagenaer | last post by:
Hello, I'm building a simple shopping cart to work with PayPal. I'd like to have the user post his basket to my page, validate the input, then redirect him _with his validated form data_ to PayPal using header("Location:"). I could just have the user submit his form to PayPal, but then I don't have any control over what he submits (tweaking the form is easy). I can include the form data as a search string in the redirect URL but that creates...
4
9169
by: andre rodier | last post by:
Hello, I need to display or propose a jpeg image on a web page. When I need to display the image, I use this code : header("Content-Length: $fileSize") ; header("Content-Type: $type") ; header("Content-disposition: inline") ; header("Location: $imageURL"); And when I need to propose the image to save, I use this one :
6
3275
by: webgenius | last post by:
I'm designing a small site and I have this structure in mind: index.php --------------- login fields. User enters login info. LoginCheck.php is called. LoginCheck.php ----------------------- Login info are POST collected and checked in DB. If successful, session variables are set. Then redirected to index.php using header("location:index.php");
5
11797
bilibytes
by: bilibytes | last post by:
hi, i am making a website with php OOP. i have a class called session: it has the attribues -logged_in; -user_name; -user_ip; -user_level;
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8895
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7728
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.