RE: [PHP-WIN] Re: URL querystring values (simple problem)
| From: | Rich Gray | Date: | Thu, 08 Aug 2002 05:13:45 +0000 |
| Subject: | RE: [PHP-WIN] Re: URL querystring values (simple problem) | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-15175@lists.php.net to get a copy of this message | ||
If globals was on then the $example var would have been set in your script.
All query string (get method) and posted vars would have been created
automatically.
You can emulate globals being set to on by doing this in your script... this
has implications security wise as well, so if you're gonna do this you may
as well switch globals on...
extract($_GET);
extract($_POST);
Rich
-----Original Message-----
From: Frank Tudor [mailto:ftudor@skychefs.com]
Sent: 07 August 2002 13:59
To: php-windows@lists.php.net
Subject: Re: [PHP-WIN] Re: URL querystring values (simple problem)
So if I have globals on and I need to pass a value what would I do.
"Dash Php" <dash.php@westonefcu.org> wrote in message
news:ABA3F1F1A223D411BE6C006008A6F7E26046A1@MSX1-PTON...
> Try this:
>
> <input type="text" name="example" value="<?php echo
> $_GET['example'];?>"
/>
>
> It's easier to use PHP like that instead of 'echo'ing the whole line.
>
> -Dash
>
> p.s. the $_GET is for 4.2.x with register_globals set (rightly) to off.
>
> -----Original Message-----
> From: Frank Tudor [mailto:ftudor@skychefs.com]
> Sent: Wednesday, August 07, 2002 12:40 PM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Re: URL querystring values (simple problem)
>
>
> Here is the code from my test.php page it may seem basic but if my page is
> called test.php and then I have a url like http://test.php?example=11h°”Ïù£ð
> ºÍòú2¤1
>
> why to I get a blank screen shouldn't something generate like the form
test
> tag and then populate anumber 11 in the field?
>
>
> <?php
>
>
> echo "<input type=\"text\" name=\"example\"
> value=\"{$example}\" />";
>
> ?>
> -----------------
> I have the most basic problem. I am trying to pass a value from a
> url/querystring like
>
> http://test/test.php?example=11
>
> so now how to I get it in a <input type="text" name="example"> on a
> page
> called test.php.
>
> This must be so simple and I am overdoing it.
>
> I am generating this url to be sent in an email to people and I want this
> value in a form text box to make it easy for the user and all they have to
> do is hit submit.
>
> Thanks,
> Frank
>
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php