The following code succesfully refreshes the #content div, but in doing so it clear the $name variable which is passed from a previous page. How can I reload the div without losing my variable? The following is the code in "thispage.php". Any help would be appreciated!
<html>
<head>
<script>
setInterval(function() {
$('#content').load('thispage.php #content');
}, 3000);
</script>
</head>
<body>
<?php
include 'php/db.php';
$name = $_POST['name'];
echo '<div id="content">';
$ad= mysql_one_data("SELECT ad FROM tab1 WHERE name = '$name'");
echo 'Address ' .$ad. ' <br>';
echo '</div>';
?>
</body>
</html>