I am using Jquery Popup-Form to send coupon code (which came from database) on email and through SMS. I am using to store couponcode in a session; but the page called by Jquery is not showing the value of session, I wrote session_start() at the top on both pages, still no luck.

Try with the following example:

<?php
session_start();

if ($_GET['get']){
  echo "resp:".$_SESSION['v'];
  die();
}

$_SESSION['v'] = 'SECRET CODE';

?>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
</head>
<body>

<a href="#" onclick="get();">click</a><br />
<script type="text/javascript">
function get(){
  $.get('?get=1', function(data) {
  alert(data);
});  
}
</script>
</body>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.