RE: [PHP] php trouble
| From: | John W. Holmes | Date: | Sun, 09 Mar 2003 04:22:23 +0000 |
| Subject: | RE: [PHP] php trouble | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138829@lists.php.net to get a copy of this message | ||
> Benny Pedersen wrote:
>
> >how do i get var from a url like this one
> >
> >http://localhost/index.php?sort=name&var2=login
> >
> >
>
> In index.php:
>
> echo $sort;
> echo $var2;
And if you're wondering why that doesn't work (if it doesn't), then try
echo $_GET['sort'];
echo $_GET['var2'];
and read up on the "register_globals" setting in your php.ini file.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/