Re: Using the GET Method
| From: | Dash McElroy | Date: | Sun, 12 Jan 2003 04:48:53 +0000 |
| Subject: | Re: Using the GET Method | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-17783@lists.php.net to get a copy of this message | ||
Ah, You're the latest of the ones to get hit by the register_globals
setting. There are two things to do:
1. Change your code to reference the METHOD referenced in the form page
GET -> $_GET['varname']
POST -> $_POST['varname']
COOKIE -> $_COOKIE['varname']
SESSION -> $_SESSION['varname']
GPC (Get Post Cookie, in that order) -> $_REQUEST['varname']
See php.net/register_globals for this.
2. Change your php.ini settings from:
register_globals = off
to
register_globals = on
then restart your server.
Now, I just have to ask myself why I don't have a canned message for
this...
-Dash
Know thyself. If you need help, call the C.I.A.
On Sat, 11 Jan 2003, Wade wrote:
> 01112003 2132 CST
>
> Im working on learning PHP4 by reading Beginning PHP 4, Wrox Press.
> Chapter 3, page 76.
> Im working with a form field sending data via the GET method.
> On the first page, you fill in a text field and hit send.
> That data is sent via the URL.
> I can see it in the URL, on the next page.
> The page will not show the data in the variable spot.
>
> The Code:
>
> Page One
> <html><head><title></title></head>
> <body>
> <form method=get action="text.php>
> Who is your favorite author?
> <input name="author" type="text">
> <br>
> <input type=submit>
> </form>
> </body></html>
>
> Page Two - text.php
> <html><head><title></title></head>
> <body>
> Your favorite author is:
> <?php
> echo $author;
> ?>
> </body></html>
>
> Now, I know PHP is case sensitive and I have been sure to check the
> $variable in the code. I have worked through some other pages in this
> book and I downloaded the documentation from the wrox website. Their
> code is exactly as the book and my own.
>
> Im stumbed. Anybody read this book? Can anybody see something wrong?
>
> Wade
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>