Re: newbie: problem with $_Post[]

From: Date: Tue, 28 Jul 2009 03:40:29 +0000
Subject: Re: newbie: problem with $_Post[]
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-295907@lists.php.net to get a copy of this message
On Mon, Jul 27, 2009 at 10:31 PM, A.a.k<blueman@gmail.com> wrote: > Hello > I have a very simple test form named "pass.php"  : > > <form action="pass.php" method=POST> > username : <input type=text name=user ><br /> > password : <input type=password name=pass> <br /> > <input type=submit value="go"><p> > </form> > > <?php > $user=$_POST['user']; > $pass=$_POST['pass']; > if(($user=="myname")&&($pass="mypass")) > echo "access granted"; > else > echo "access denied"; > ?> > > getting "Notice: Undefined index: user" and "Notice: Undefined index: > pass". > changing form action to another page will solve the problem but i want to be > able to use $_POST array on the same page, how can i do it? > thanks in advance > > /Arash > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Define them $user=''; $pass=''; -- Bastien Cat, the other other white meat

« previous php.general (#295907) next »