473,800 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

header() sometimes fails, sometimes works, same url

<?
header('Pragma: no-cache'); // ENSURE CLIENT-SIDE CACHE FLUSHING
$url = "$projectURLPat h/index.php";
if ($_REQUEST['logoutMsg']) $url .= '?logoutMsg='.
urlencode($_REQ UEST['logoutMsg']);
if ($willAuthentic ate && $willUseSSL) {
$dest = 'https://' . $_SERVER['SERVER_NAME'] . $url;
} elseif ($willBasicAuth enticate && $willUseSSL) {
$dest = 'https://EnterYourUserNa me:EnterPasswor d@' .
$_SERVER['SERVER_NAME'] . $url;
} elseif ($willAuthentic ate) {
$dest = 'http://' . $_SERVER['SERVER_NAME'] . $url;
} elseif ($willBasicAuth enticate) {
$dest = 'http://EnterYourUserNa me:EnterPasswor d@' .
$_SERVER['SERVER_NAME'] . $url;
}
header("Locatio n: $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 1269

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

Similar topics

10
9382
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"); ?> Should it not redirect to www.google.com? I can't get the header() function to redirect. I'm trying to take an online reservation... the customer fills out
24
1916
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 std; Seams like some things in my header files are in std namespace and some are not. Is that correct, or is my compiler (mingw, 3.2 i think) horribly broken? :o) Thanx, Martin
8
2359
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 xmlns="http://www.w3.org/1999/xhtml"> All the CSS layout stuff looks good.
16
12644
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. I have tried and tried but just cant seem to get this right, I am using Queries to created my export files with specifications which works fine, I get stumped with the appending the header to my transaction file. What I have so far looks like...
9
3254
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 is that it behaives differently when accessed from different locations even where IE browsers are the same version. It works without any problems on localhost. It also works without any
0
4672
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 another web service that validates a security token in the header. I have pasted my current SOAP message that my code sends as captured from a trace function that I added. Below that is a sample SOAP message that the developer of the web...
2
2225
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 fails, the error returned is "there was an error processing the <Security> header". If I run the client on the server there is no problem. Help!
3
2680
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 websites so I have to check if the image returned is fine or not. This is not that problematic, I can read the headers and understand if it is a jpg or a gif (the error one). The problem that I have is that sometimes although they have the...
0
3736
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 BEFORENAVIGATE2, I am canceling the current navigation and renavigating with the new custom header using Navigate2. This usually works fine, but in some cases (particularly when selecting a link that starts a new window), the Navigate2 call fails.
0
9691
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
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...
0
10276
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9090
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...
0
6813
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
5471
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...
1
4149
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
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.