RE: [PHP-WIN] Redirect browser to another URL?
| From: | Rich Gray | Date: | Thu, 28 Nov 2002 10:05:24 +0000 |
| Subject: | RE: [PHP-WIN] Redirect browser to another URL? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-17187@lists.php.net to get a copy of this message | ||
Hi Max
Well it seems you are messing around with text files rather than a
database - this sounds like hard work :) I'm not sure I fully understand
your issue but are you saying you could not make the code 'refresh' the
comments data on the form page without a javascript redirect?
What happens if you switch off javascript in your browser - does it fail?
Rich
-----Original Message-----
From: Max Graham [mailto:czero@lonebraincell.com]
Sent: 28 November 2002 05:51
To: php-windows@lists.php.net
Subject: Re: [PHP-WIN] Redirect browser to another URL?
You know, this is exactly what happened to me. I was trying to design a
comments page for a weblog to open in a popup. The page had a submission
form that would submit back to itself. 'course, I was banging my head on the
wall trying to come up with a way to get the page to detect whether it had
received a form submission and write the comments to a comment file, and
then include the comment file with the form afterwards. I kept coming up
with the results of fopen(), fputs(), fflush(), and fclose() coming back as
false, which equals failed. I eventually did go to a separate page to do the
file writing, and that page finishes up with a 1-second delay using the
javascript setTimeout() for this command in a standalone function:
echo "location.replace('blogcomments.php?target=".$target."');\n";
Inelegant, but it works. I haven't had too much experience with the header
function, and knowing how long it took me to bang this one out, I might set
something on fire trying it :)
Anyone else had any fun with this issue?