You are here: Re: Pass value to header? « PHP Programming Language « IT news, forums, messages
Re: Pass value to header?

Posted by Ken Robinson on 04/28/06 17:33

Garry Jones wrote:
> When processing a form I am reading in a value to a mysql database. I then
> redirect the user to a "thank you" page with Header. What I would like is to
> remind the user the value he/she keyed in. Can I pass the variable in the
> Header command?

[snip]

> Header("Location: http://www.mydomain.com/thankyou.php");
> exit;
>

There are two different methods you can use:
1) Put the value into a session variable. Before the 'header()"
function, put

$_SESSION['inx01'] = $inx01;

Then in the thankyou.php script, you can get the value by referencing
$_SESSION['inx01']

Be sure you put

session_start();

at the start of each script.

2) Pass the value on the URL:

header('Location: http://www.mydomain.com/thankyou.php?inx01=' .
$inx01);

and the you can use the value in $_GET['inx01']

Ken

 

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

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