Using this ajax code i am passing data speedMbps from my javascript to php. however when i tried to use the speedMbps in php i am getting a Undefined index: speedMbps. what should i do so i can use speedMbps in php?
Edited: video_id is send using html form post.
$.ajax({
method: "POST",
url: "viewvideo.php",
data: {speedMbps: speedMbps },
cache: false
}).done(function( html ) {
$( "#speed" ).val( html );
});
php file
if(isset($_POST['video_id']) && ( $_POST['speedMbps'] )){
$speed = $_POST['speedMbps'];
if ($speed < 100) {
}