RE: [PHP] variables not passing thru form
| From: | John W. Holmes | Date: | Tue, 22 Oct 2002 16:41:18 +0000 |
| Subject: | RE: [PHP] variables not passing thru form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120948@lists.php.net to get a copy of this message | ||
This is probably a register_globals problem. It defaults to OFF with
newer versions of PHP. You must use $_GET['name'] or $_POST['name']
(depending on your method) instead of just $name.
It's advised you keep register_globals OFF and learn to program with the
new arrays. The really are a lot easier when you get used to them.
---John Holmes...
> -----Original Message-----
> From: Davinder [mailto:lists@mahal.org]
> Sent: Tuesday, October 22, 2002 12:34 PM
> To: php-general@lists.php.net
> Cc: Davinder
> Subject: [PHP] variables not passing thru form
>
> Hi,
>
> I'm trying to do a simple form and just pass a few variables thru a
> form to the next page. Its a simple concept however it just doesn't
> want to work. I've tried using the post and get method.. neither work.
> I've also taken code directly from some tutorials and even that
doesn't
> work. Is there something that i did to the php modules that dont allow
> passing of variables?
>
> for example even this wont work:
>
> html page:
>
> <html>
> <head><title>Title of the page</title>
> </head>
>
> <body>
>
> <a href="welcome.php?name=Davinder">Pass me</a>
>
> </body>
> </head>
>
>
>
> and then php page:
>
>
> <html>
> <head><title>Title of the page</title>
> </head>
>
> <body>
> <?php
> echo "The value passed thru is ";
> printf($name);
> ?>
>
> </body>
> </head>
>
> This was taken pretty much right from a tutorial. Doesn't work?! I've
> had them pass before in a previous version of an install.. i have
since
> wiped the drive and reinstalled everything.
>
> Please help.
>
> Davinder