You are here: Re: Hyperlink and passing of variables. « PHP Programming Language « IT news, forums, messages
Re: Hyperlink and passing of variables.

Posted by Shelly on 07/24/05 14:27

<opt_inf_env@yahoo.com> wrote in message
news:1122202838.611526.302440@o13g2000cwo.googlegroups.com...
> Hello,
>
> I know three ways to pass variables form one page to another. The first
> one is to declare and set session variable.

Assuming that you have session_start() at the beginning of both pages?

> In this case if one goes to
> another page (by clicking on hyperlink or pressing a button) value of a
> session variable will be automatically seen on the new page. The second
> way is to set hidden variables in the form and go to new page by
> execution of this form (press a button or enter),

???? Hitting the enter button will only have variables on that page unless
you do what you call the first or third methods. What do you mean here?

> and the last way,
> which I know, is in the declaration of hyperlink after name of a new
> page put after "?" names and values of variables. Sometimes I need
> to use the third way. However I do not like that after new page is
> loaded in the address line of browser one can see all variables (names
> and values). Can one avoid this problem?

Yes. Create a variable which is an array. Put in the values you want for
each variable as:

theArray['first_var'] = first value;

Then create a single session variable which is $_SESSION['theValues'] =
$theArray and pass that single array via the ?thevalues = $theArray.

At the other end you say:

theArrayReceived = $_GET['thevalues'];

and you have an array that you can get the values via the indexing.

I haven't tried it, but it might also work without the creation of the
session variable step. IOW, say

?thevalues=theArray; and on the other end say theArrayReceived=
$_GET['thevalues'];

When I get home from vacation, I will try it. If you try this and it works
without the session variable step, please let me know.

Shelly

 

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

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