Q:

User data not sent, PHP

I am making a site for taking still photos of students. Whenever I try to move the data that has been collected from my prompt and upload my picture with the "ID" from the prompt, the data does not get transferred. Not sure how much of the code you need, so tell me if I can help you help any further! All my pictures get saved as is ".jpg".
var CPR;
function IndtastCPR() {
    CPR = prompt("Indtast dit fulde CPR uden bindestreg", "0807934711");
}

-
 // Upload image to sever 
 document.getElementById("upload").addEventListener("click", function(){
     var dataUrl = canvas.toDataURL("images/", 0.85);
     $("#uploading").show();
     $.ajax({
         type: "POST",
         url: "html5-webcam-save.php",
         data: { 
             imgBase64: dataUrl,
             user: CPR
         }
     });
});

And then the html5-webcam-save.php
$rawData = $_POST['imgBase64'];
$filteredData = explode(',', $rawData);
$unencoded = base64_decode($filteredData[1]);

//$datime = date("Y-m-d-H.i.s", time() ) ; # - 3600*7

$userid  = $_POST['userid'] ;

// name & save the image file 
$fp = fopen('images/'.$userid.'.jpg', 'w');
fwrite($fp, $unencoded);
fclose($fp);

A:

TYPO CAPTAIN HERE.
must be userid, and not user.
     userid: CPR

