Re: "GET" method can not get variables

From: Date: Fri, 04 Apr 2003 00:51:28 +0000
Subject: Re: "GET" method can not get variables
References: 1  Groups: php.install 
Request: Send a blank email to php-install+get-10497@lists.php.net to get a copy of this message
You must define your variables in the FOO.PHP page. Try this: <?php $uname=($_GET['username']); $mail=($_GET['email]); print ("hello, username = $uname, $mail"); ?> Also, POST is probably a better choice than GET. "E.E. Jan" <ejan@us.ibm.com> wrote in message news:20030304132723.26317.qmail@pb1.pair.com... > Could anybody give me a pointer for my problem? > I just installed php 4.3.1 on my w2k platform > I also installed Apache 2.0.43. > I can get "hello world" and "phpinfo()" working. > However, when I try a simple form like this following: > > > <html> > <title> test </title> > <body> > <form action="foo.php" method="get"> > Name: <input type="text" name="username"><br> > Email: <input type="text" name="email"><br> > <input type="submit" name="submit" value="Submit me!"> > <input type="reset" name="reset" value="reset!"> > </form> > </body> > </html> > > > and my foo.php is > <?php > print ("hello, username = $username"); > ?> > I got : hello, username = > The $username is alwasy empty..... > I know my form and GET action is working. I saw the following query string > in url after I hit submit button: > http://localhost/myphp/foo.php?username=qwe&email=123@us&submit=Submit+me%21 > However, php is not able to get varialbe $username and $email > > Any ideas? > > I tried the same script is ipower website, it works... > Do I miss any thing in php.ini? > I also switch to apache 1.37, I got the same results. The variable is still > empty. > > Thanks > E.E. > > >

« previous php.install (#10497) next »