I want to use some URL for data to retrieve using post method with redirect rule or without it in PHP. But, as it will have no extension like .php.
Example:- http://localhost/folderA/file
Also, have to send some data in post method. So, please help to get it solved.
Thank you help.
This is the HTML code what I am using.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#2f3d44" />
<title>Test</title>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
</script>
</head>
<a name="top"></a>
<style>
html,.wrap{height:100%;}
.wrap{display: inline;}
</style>
<body class="blacker">
<div class="modal fade-scale" id="reglogin" tabindex="-1" role="dialog" aria-hidden="true" data-keyboard="false" data-backdrop="static" style="z-index:2001;">
<div class="modal-dialog modal-md">
<div class="loginformpop popdiv">
<div class="form-container signup-form-container">
<h4>LOGIN</h4>
<div class="form-row">
<input type="email" name="email" id="poplogin_email" value="" class="inputbox " maxlength="255" size="50" style="" placeholder="Email">
</div>
<div class="form-row">
<input type="password" name="password" id="poplogin_password" value="" class="inputbox " maxlength="255" size="50" style="" placeholder="Password">
</div>
<div class="form-row form-submit">
<button id="poploginbtn" value="JOIN NOW" class="signupbutton btn btn-danger" onclick="callAuthenticate()">LOGIN</button>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="res/bootstrap.min.js"></script>
<script>
function callAuthenticate(){
var userAccount = {'UserName':'test2', 'Password':'test123!'};
var post_data = {"PlayerId":"104", "Account":userAccount};
$.ajax({
type: "POST",
url: "http://host/folderA/file",
data: post_data,
dataType: "json",
xhrFields: {
withCredentials: true
},
success: function(d){
},
error: function(d){
console.log(d);
},
complete: function(){
}
})
}
</script>
<script>
$(document).ready(function(){
});
</script>
<div id="hiddenframe" style="height:1px; width:1px;"></div>
</body>
</html>
Note:- On the local server, it is working well. But, on the remote server, it is not working. There is no message coming for it. I have used .htaccess for redirecting
<IfModule mod_rewrite.c>
RewriteEngine on
Redirect 301 /file /file/index.php
</IfModule>