I am trying to run a PHP script from when submit button is clicked in my HTML code. I installed tomcat server on my remote linux server and its running fine. I even tested running sample PHP on it and its fine. I have tried below code on my local desktop and able to run the php script without any issues.
But when i run it from my remote linux server, the output when i am clicking the submit button is the PHP script itself on the page. Not able to understand exact mistake. Kindly guide me. Thanks.
<button type="button" class="btn btn-success" id = "button" value="submit" >Submit</button>
<script>
$(document).ready(function () {
$('#button').click(function () {
alert("first")
$.ajax({
type: "GET",
crossDomain: true,
url: "http://localhost:8085/ElitePass/login.php",
data: {
stime: $("#demo1").val(),
etime: $("#demo2").val(),
desc: $("#servername").val()
},
success: function(data){
alert(data)
$('#resultip').html(data);
},
error:function(data)
{
alert("Data sending failed");
}
});
});
});
</script>