473,388 Members | 1,177 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,388 software developers and data experts.

header() sometimes fails, sometimes works, same url

<?
header('Pragma: no-cache'); // ENSURE CLIENT-SIDE CACHE FLUSHING
$url = "$projectURLPath/index.php";
if ($_REQUEST['logoutMsg']) $url .= '?logoutMsg='.
urlencode($_REQUEST['logoutMsg']);
if ($willAuthenticate && $willUseSSL) {
$dest = 'https://' . $_SERVER['SERVER_NAME'] . $url;
} elseif ($willBasicAuthenticate && $willUseSSL) {
$dest = 'https://EnterYourUserName:EnterPassword@' .
$_SERVER['SERVER_NAME'] . $url;
} elseif ($willAuthenticate) {
$dest = 'http://' . $_SERVER['SERVER_NAME'] . $url;
} elseif ($willBasicAuthenticate) {
$dest = 'http://EnterYourUserName:EnterPassword@' .
$_SERVER['SERVER_NAME'] . $url;
}
header("Location: $dest"); // DEFAULT REDIRECT TO MAIN PAGE
exit();

?>

This code scriptlet will allow for redirection to dynamically relocate
to another URL. However, for some bizarre reason, it will not redirect
anywhere; it just dies (no warnings, no errors, no notices, no
nothing!), however, if you refresh your browser, the redirected page
appears, sometimes after 1, 2, 3 tries. Then sometimes it redirects
with no problems at all.

I tried closing my browser, logging out, refreshing everything,
deleting cache/history.. to no avail.

This only started occurring the moment I used my SessionHandler class
to relocate session files elsewhere due to a business requirement - the
moment I removed SessionHandler, this redirection weirdness occurred
and no amount of debugging seems to be able to solve the problem.

Ideas? Help?

Phil

Dec 7 '06 #1
0 1236

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

Similar topics

10
by: Bob Garbados | last post by:
forgive my ignorance, as I'm new to php coming from a ms background... If I create a page named redirect.php and it's only content is: <?php header("Location: http://www.google.com"); ?>...
24
by: Marcin Vorbrodt | last post by:
Hi there. How come when in one file i unclude <cmath> i need to use std::tan(...), and in another file i include <cassert> and std::assert fails to compile. Nowhere in my code i do using namespace...
8
by: Terry | last post by:
Hi, I built a website using the HMTL header: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
16
by: Michael | last post by:
I have a data application in a2k that I need to create two fixed width text files and then combine them to a single file The first file is header information and the second is transaction data. ...
9
by: Klem | last post by:
Hi I am expiriancing a very,very strange problem. I have an asp.net application that hangs (sometimes) when trying to execute Response.Redirect("page.aspx",true) command. What is very strange...
0
by: Daniel Thune, MCSE | last post by:
I am having a problem with formatting a SOAP Header in a .Net client. The client calls a Java Axis 1.1 based web service. In order to authenticate the caller, the web service call is intercepted by...
2
by: Naeem Sarfraz | last post by:
Any advice for the following situation? I've deployed my webservice on a remote server, e.g. http://mywebservice.co.uk/summary.asmx. The windows clients attempts to access this webservice and...
3
by: christiang | last post by:
Hi guys, I'd like to use Alexia thumbnail service. It's an interesting service, you pass an url to its cgi and you get a thumbnail of that url. Of course they don't have the screenshots of all the...
0
by: Dean Hallman | last post by:
Hello, I am developing a BHO that should add a custom HTTP header on a specific domain only. Don't want the header globally, otherwise I could just add a registry key. So, on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.