Ajax到PHP的未定义索引

Ive seen questions like this but none of the answers seem to work for me. Im trying to send POST data to a separate php file that would insert it into a database. I get a PHP notice: undefined index arg1 and arg2.....Here is the ajax:

function performAjaxSubmission() {
        $.ajax({
          url: 'likedata.php',
          method: 'POST',
          data: {
            'action': 'save',
            'arg1': '<?php echo $_SESSION['userId'];?>', 
            'arg2': '<?php echo $p;?>'

          },
          success: function() {
            alert("success!");
          }
        });
        return false; // <--- important, prevents the link's href (hash in this example) from executing.
      }

      jQuery(document).ready(function() {
        $(".icon-thumbs-up").click(performAjaxSubmission);
      });

and here is the likedata.php

if(isset($_POST)){
$liker = $_POST['arg1'];
$likee = $_POST['arg2'];

$profile->insertLikes($liker, $likee);


}

thanks!

        'arg1': "<?php echo $_SESSION['userId'];?>", 
        'arg2': "<?php echo $p;?>"

You have single quotes inside single quotes without escaping.

$.post("likedata.php",{
'arg1': "<?php echo $_SESSION['userId'];?>", 
'arg2': "<?php echo $p;?>"postaction:'action' },
function(data){
  .
  .
  .
},'json');