You are here: Re: redirection question « PHP Programming Language « IT news, forums, messages
Re: redirection question

Posted by Carl on 01/30/07 23:34

On Jan 30, 3:09 pm, Gunnar G <deb...@comhem.se> wrote:
> Perhaps this is not the best design right now in my php script, but I've
> just started with php after a long break.
>
> The thing is that I enter a page called foo1.php, this script do some
> calculations and should then send directly send the user to a page called
> foo2.php together with the variables $bar and $bar2.
>
> On the page foo1.php there will be no input or any clicking required by the
> user. Just as soon as the values are calculated, it should continue.
> How can I achieve this?


If the data is not sensitive, you can simply use the header() function
to redirect to the appropriate page passing the variables as
parameters in the URI.

i.e.
header('Location: http://site.com/somepage.php?foo=$foo&bar=$bar");

Otherwise, if you need to hide the parameters, or do not want the page
to be bookmarked you can set the parameters in the session before
redirecting and omit them from the URI.

see:
http://php.net/header
for more info.

Hope that helps,
Carl.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация