It is showing undefined function in PHP page.And i made every possible way it is not working for me.Please guys help me with this.
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
<div id="myDiv">Welcome to stackoverflow</div>
</body>
<script>
$(document).ready(function(){
var mb = $('#myDiv').text();
$.ajax({
action : "six-cuf.php",
type: 'POST',
data: { 'mb': mb},
success:function(data)
{
alert(mb);
}
});
});
</script>
</html>
PHP CODE
<?php
$fname = $_POST['mb'];
?>
2
Answers
Hello
You can also try this JQuery Post Method
Javascript Code
PHP code