I am trying to send a variable from the browser when a use logs into the server.
I am not able to achieve that…
php code:
<?php
echo "test";
$email = $_REQUEST['email'] ;
echo $email;
?>
html page:
<html>
<head>
<title>Demo</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<script>
alert("test");
$.post("receiver.php", { email: "John", message: "2pm" } )s;
</script>
</body>
</html>
Can you please let me know what I am missing . looks I am missing some thing very basic..
echo test in the php file is also not printing
You need to define a function that handles whatever’s returned by the php (you also had a slight syntax error like @tigrang said). Try this: