Hi,
This is my first post in this forum and am a PHP beginner. I have written a script in php and need to use echo to see the values of variables etc. However I dont get the output on the screen while using echo . I am using Xampp server with Apache.
The startup.html file code is
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<title>Test Page</title>
<script>
$.ajax(
{
url: "http://localhost:8081/test.php",
type: 'POST',
dataType: 'text',
data: {latitude: '7.15588546', longitude: '81.5659984458'},
success: function (response)
{
alert(response);
},
error: function (response)
{
alert(response);
}
});
</script>
</head>
<body>
<p>hello</p>
</body>
</html>
and the test.php code is
<?php
$lat = $_REQUEST['latitude'];
$lon = $_REQUEST['longitude'];
echo 'latitude- '.$lat . ', longitude- ' . $lon;
?>
Please help
regards
Sanjish