# \[PHP\] Form Variables

**URL:** <https://forum.kirupa.com/t/php-form-variables/190438>\
**Category:** Uncategorized\
**Created:** [June 11, 2006, 9:25pm UTC](https://forum.kirupa.com/t/php-form-variables/190438 "2006-06-11T21:25:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [June 11, 2006, 9:25pm UTC](https://forum.kirupa.com/t/php-form-variables/190438/1 "2006-06-11T21:25:33Z")

</div>

Psuedo code:

```php

$user = $_POST['user'];
$password = $_POST['password'];

if((!$user) or (!$password))
{
   // form code
   // action = self
}
else
{
   // check database for match
   // reload page if no match
}

```

When this page first loads, it will only run the “if” code. On the first try, a user fills out both fields so the page reloads and then runs the “else” code. He fails to provide a valid username and password, so the page reloads a second time. On this second reload, will $user and $password be null?

I’m having the problem that on the second reload, those variables appear to not be null, so NO code is run at all!
