Forum Moderators: coopster

Message Too Old, No Replies

Blocked Redirects?

Although my code appears to work for 70% of my traffic 30% don't redirect

         

lubeguy

12:17 am on Nov 15, 2005 (gmt 0)

10+ Year Member



I have a survey in which ends with a redirect to a thank you page. This works for most people, but some do not get to the thank you page. I have tried different browsers myself and have not been able to replicate the problem. I am thinking it is some sort of a security thing, because coincidentally all the people that have this proble have there cookies turned off and any request for the user agent fails as well. But some people who have there cookies turned off don't seem to have a problem. Here is the line of code I am using for the redirect:

$insertGoTo = "http://www.example.com/surveys/thankyou.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?'))? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));

If anyone has ideas what could be causing the problem, please let me know.

[edited by: coopster at 2:07 pm (utc) on Nov. 15, 2005]
[edit reason] generalized url [/edit]

jdMorgan

12:35 am on Nov 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> but some do not get to the thank you page.

1) How did you come to this conclusion?

2) What cache-control headers do you send with the Thank-You page?

If your conclusion is based only on your access logs, and you have allowed the thank-you page to be publically-cached, then many users' requests may be served from within their ISP's caching system (e.g. AOL users).

Jim

lubeguy

4:16 pm on Nov 15, 2005 (gmt 0)

10+ Year Member



1. The thank you page runs some queries that insert the address from the survey into a different database. Also if certian conditions are met on the survey it gets inserted into another database and deleted from the original database. It then goes to a second thank you page. These things are not happening. Since I can't replicate the problem myself, (it works fine when I complete a survey) and I know the code works since the majority of surveys complete the process fine. It would appear as if the page is not loading or being executed. I know it is a big assumption but I have not been able to narrow it down past that.

2. <META HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta name="expires" content="0">

lubeguy

7:51 pm on Nov 15, 2005 (gmt 0)

10+ Year Member



I still don't know what was causing the initial problem, but I fixed it by skipping the redirect and just having all my queries run from the same page.

If anyone knows what caused this in the first place please reply, I am still interested in learning what went wrong.