I am trying to pass a selection/value from a dropdown menu which was dynamically created to php file and store it in a session variable, but the php is not getting any parameter. This is my code in the Jquery file:
$('#fgdesignation').change(function ()
{
var project =$("#fgdesignation option::selected").text();
var url='backend.php';
// alert(project);
$.post(url, {fgdname : project});
});
and this is the php file:
if(isset($_POST['fgdname'])) {
$fgdname= $_POST['fgdname'];
$_SESSION['fgdname']=$fgdname;
}
Thank you!