Re: newbie: problem with $_Post[]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 27, 2009 at 10:31 PM, A.a.k<blueman@xxxxxxxxx> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux