Open URL while passing POST data with jQuery
$(button).click(function(){
var s_name=$("#txtbox").val();
$.post("http://localhost/AJAX/save_session.php",
{
student_name: s_name,
},
function(data){
location.href='http://localhost/AJAX/result.php';
});
// On http://localhost/AJAX/save_session.php
<?php
session_start();
$_SESSION["name"]=$_POST['student_name'];
?>
// On result.php
<?php
session_start();
include("config.php");
$name=$_SESSION["name"];
?>