ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-general
php-general
RE: [PHP] php redirection..
by Tim other posts by this author
Dec 12 2006 12:05PM messages near this date
Re: [PHP] Whitespace in Emails | Re: [PHP] php redirection..
Just a quick question regarding this issue.

Considering bruce wants to be able to display the data and then change
location after a given time, and as stut said you can't do this with a
header() as it redirects before output, I would have imagined a dynamic meta
tag in the header with a time variable and a location variable.

But then I wonder what affect this has regards to html standards? 
Are dynamic meta tags depreciated?

Regards,
Tim

>  -----Message d'origine-----
>  De : Stut [mailto:stuttle@[...].com]
>  Envoyé : mardi 12 décembre 2006 19:52
>  � : bedouglas@[...].net
>  Cc : php
>  Objet : Re: [PHP] php redirection..
>  
>  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@[...].com]
>  > Sent: Tuesday, December 12, 2006 9:21 AM
>  > To: bedouglas@[...].net
>  > Cc: php-general@[...].net
>  > Subject: Re: [PHP] php redirection..
>  >
>  >
>  > bruce wrote:
>  >> i want to be able to display some text/content and to then redirect the
>  > user
>  >> to another page.
>  >>
>  >> 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 the
>  > content
>  >> ok. when i add the script/location.href, i get redirected, but the
>  content
>  >> is never displayed...
>  >>
>  >> any thoughts/samples/pointers on what might be going on, and how this
>  > should
>  >> really 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
>  >
>  
>  --
>  PHP General Mailing List (http://www.php.net/)
>  To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Tim
Budi Setiawan
Youri LACAN-BARTLEY
Brad Fuller
Bruce
Brad Fuller
Bruce
Casey Chu
Casey Chu
Tedd
Youri LACAN-BARTLEY
Tim
Tim

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved