Re: Passing vars
| From: | Tanya Brethour | Date: | Wed, 14 Feb 2001 21:48:14 +0000 |
| Subject: | Re: Passing vars | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-db+get-6645@lists.php.net to get a copy of this message | ||
Yes.. the problem with the hidden method.. is the following.
Let says I use the string "Testing the \"waters\" "
Now.. if I do a <input type=hidden value="<?echo $var?>"> the qoutes in my
string do not escape correctly. So when you look at the source in
netscape.. it ends the string at \ ... just before the first qoute.
So.. is there any other way besides those two methods? Can I pass a object
through the URL?
-Tanya
On Wed, 14 Feb 2001, Maureen wrote:
> I may be totally wrong or missing something, (if so, someone please let
> me know) but ...
>
> 1. One way would be to use the variables and urlencode them before
> passing them.
> $var1=urlencode($var1)
> then you have test.php?cheese="<?echo $var1?>"
>
> OR
>
> 2. Another way would be to use a form:
> <form method=post action="test.php">
>
> and then add the 6 variables as
>
> <input type=hidden name="var1" value="<?echo $var1?>">
> <input type=hidden name="var2" value="<?echo $var2?>">
> <input type=hidden name="var3" value="<?echo $var3?>">
> <input type=hidden name="var4" value="<?echo $var4?>">
> <input type=hidden name="var5" value="<?echo $var5?>">
> <input type=hidden name="var6" value="<?echo $var6?>">
>
> and then have a submit button to take you to the next page.
>
> Tanya Brethour wrote:
>
> > Quick question..
> >
> > If I have like 6 variables to pass to another PHP script... and some of
> > the vars are actually multiple lines of text (lets say over 30 lines).
> > What is the best way of doing this?
> >
> > I would like to avoid doing something like test.php?cheese=(30 lines of
> > stuff)
> >
> > Thanks in advance!
> > -Tanya
>