# Undefined Index: action?

**URL:** <https://forum.kirupa.com/t/undefined-index-action/194420>\
**Category:** Uncategorized\
**Created:** [July 23, 2006, 7:54am UTC](https://forum.kirupa.com/t/undefined-index-action/194420 "2006-07-23T07:54:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![denizengt](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@denizengt](https://forum.kirupa.com/u/denizengt)\
**Post date:** [July 23, 2006, 7:54am UTC](https://forum.kirupa.com/t/undefined-index-action/194420/1 "2006-07-23T07:54:14Z")

</div>

I have thus error occuring here:

Undefined index: action in **/var/www/thefubaredsite/htdocs/login.php**

login.php:

```php

<form name="login" method="POST" action="login.php">
        <p><br>
&nbsp;Username:
          <input type="text" name="user" id="user">
    </p>
        <p>&nbsp;Password:
              <input type="password" name="pass" id="pass">
        </p>
        <p align="right">
          <input type="submit" name="submit" value="submit">
       </p>
      </form>

<?php if($_POST['action']=='submit'){
 $theSentry->checkLogin($_POST['user'],$_POST['pass'],10,'index.php','login.php?action=error');
}
?>

```

Where $theSentry is a login check I am using from a tutorial online. I have tried defining ‘action’ to no avail, and note this works in php 5.1.2 but not the latest 5.1.4. Does any one have any ideas here? 🔗
