How can I change a parameter in a PHP file using jQuery? Here is my code, I do not understand why when I click the button the value for $val
it doesn't change:
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery-1.10.2.min.js">
</script>
</head>
<body>
<script>
$(document).ready(function(){
$("button").click(function(){
$("#test").hide();
$.get( "jqueryphp.php", { name: "John", time: "2pm" } );
});
});
</script>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p id="test">This is another paragraph.</p>
<button>Click me</button>
<?php
if(isset($_GET['time'])) $val=$_GET['time'];
else $val='parametru ne transmis 0';
echo "<br>".$val."</br>"
?>
</body>
</html>