View Full Version : Redirecting
RushScripting
January 25th, 2005, 06:31 PM
Ok here is the deal i got this calendar as you can see at www.ahhsnhs.com . If you click one of the dates it takes you to a page with info on that date and on the same page there is a for with drop down boxes so you can go to a new date. The form's action is a file called redirect_date.php and the code on the file is as follows:
header("Location: http://www.ahhsnhs.com/index.php?act=calendar&year={$_POST['year']}&month={$_POST['month']}&day={$_POST['day']}");
exit;
Well if you go to try that out it just keeps loading. I have no idea what is the problem is. If anyone has any ideas or help on how to fix this i would be very grateful
Hans Kilian
January 25th, 2005, 08:01 PM
I tried 'faking' the same request with lwp-request since that allows you to capture the headers that get sent back. This is what I got:
Location: index.php?act=calendar&year=2005
Server: Apache/1.3.31 (Unix) mod_ssl/2.8.18 OpenSSL/0.9.7a PHP/4.3.9 mod_perl/1.27 FrontPage/5.0.2.2510
Content-Type: text/html
Client-Date: Wed, 26 Jan 2005 00:36:48 GMT
Client-Junk: &month=January&day=1
Client-Peer: 198.87.84.56:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
X-Powered-By: PHP/4.3.9
As you can see, the Location gets the year part right but the month and day end up in the Client-Junk header. I have no idea why that is. Maybe my faked request has some flaw in it. But I think it works, since the year is the last variable and it gets transferred fine.
Maybe you could try putting in phpinfo() in your redirect_date.php and see what $_POST array contains.
Hans Kilian
January 25th, 2005, 08:26 PM
OK - I was barking up the wrong tree. The lwp-request was not perfect...
But I tried calling the script you're redirecting to directly by typing this URL into my browser:
http://www.ahhsnhs.com/index.php?act=calendar&year=2005&month=January&day=1
That hangs it. So the redirect works. But the script you're redirecting to (index.php) doesn't.
RushScripting
January 25th, 2005, 08:44 PM
hmmm this is very interesting, wish i could fix, i have tried meta refreshes as well with no luck. hmmm
*NOTE* Im thinking its the server because it seems to be slow and it might be broken :P
Hans Kilian
January 25th, 2005, 08:46 PM
If your index.php script isn't enormous, maybe you could post it? I'd be happy to take a look at it. Maybe not right now though, as it's almost 2 AM here and I have to go to work in the morning...
RushScripting
January 25th, 2005, 08:54 PM
its about 200 lines, im thinking i need to seperate some things and maybe make it work faster
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.