Undefined index even with isset

Viewed 282

although i used if(isset()) still get

 Notice: Undefined index: user_name in C:\xampp\htdocs\www\jq\182-186 Users online sample application\users.php

here is part of PHP code

if (isset($_POST['user_name']  , $_POST['action']) || isset($_POST['action'])){

    $user_name = $_POST['user_name'];
    $action = $_POST['action'];

EDIT: || isset($_POST['action']) IS needed for part of jquery that checks DATABASE every half second.

jquery

setInterval(function(){
    $.post('users.php', { action : 'list'} , function(data){
        $('#users_online').html(data);
        });


    },500);

so i can't delete it

3 Answers
Related