Re: [PHP] php redirection..
- From: stuttle@xxxxxxxxx (Stut)
- Date: Tue, 12 Dec 2006 18:51:53 +0000
bruce wrote:
hey stut...
Please don't reply to me directly, always include the mailing list.
thanks for the reply... i did get some output...
i also have a question as to why i couldn't get it to work when i used
'header (foo.php)'
1) The correct way to redirect using the header function is header('Location: http://domain.com/foo.php'); Note the absolute URL.
2) Using header will definitely not display any output from the page.
i did a 'ob_end_flush()' at the start, followed by a 'header()' at the end,
but the header didn't seem to function as i though it should.
I suggest you read about the header function in the manual (http://php.net/header) - you clearly don't have any idea what it does.
given that the ultimate information that i'm going to want to display will
be dynamic. some times it might be 5 lines, others 100, others 50...
i had hoped that i could somehow display the content, wait a few seconds,
and then do an auto redirect...
Like I said in my first reply, Google for the Javascript function settimeout - that's what you need.
any thoughts/comments...
I have lots of comments. Thoughts are less common but they do occasionally happen.
-Stut
-----Original Message-----.
From: Stut [mailto:stuttle@xxxxxxxxx]
Sent: Tuesday, December 12, 2006 9:21 AM
To: bedouglas@xxxxxxxxxxxxx
Cc: php-general@xxxxxxxxxxxxx
Subject: Re: [PHP] php redirection..
bruce wrote:i want to be able to display some text/content and to then redirect theuserto another page.content
basically:
cat.php
-echo " test content<br>"
-echo " more test content<br>"
//redirect user
echo"
<script>
location.href='foo.php';
</script>
";
---------------
foo.php
-echo "i'm here"
should be pretty simple...
however, in my test, without the script/location.href i display theok. when i add the script/location.href, i get redirected, but the contentshould
is never displayed...
any thoughts/samples/pointers on what might be going on, and how thisreally be accomplished..
to be honest, i'm embarrassed to even be raising this here!!
And so you should be what with it being a Javascript question and this
being a PHP list.
Anyhoo, I don't get your confusion. The browser will run the script as
it loads it from your site. Ergo, it redirects before it displays what
you have output. I suggest you Google for examples of the settimeout
Javscript function - that's what you need to delay the redirect.
-Stut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Follow-Ups:
- Re: [PHP] php redirection..
- From: "Richard Lynch"
- RE: [PHP] php redirection..
- From: "Tim"
- Re: [PHP] php redirection..
- Prev by Date: Re: [PHP] php redirection..
- Next by Date: inheritance php4
- Previous by thread: Re: [PHP] Problems with Zip+IE6
- Next by thread: RE: [PHP] php redirection..
- Index(es):
Relevant Pages
|