Answers for "Open URL while passing POST data with jQuery"

0

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"];
?>
Posted by: Guest on July-06-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language