I have a simple post request that comes from one specific page of my site:
reqdata = 'text=' + mytext;
$.ajax({
type: "POST",
url: "/request.php",
data: reqdata,
cache: false,
success: function(html) {
alert(html)
}
});
It goes to another page of the same site .. So the first page calls page mydomain.com/test.php
calls http request to mydomain.com/request.php
How do I recognise on page mydomain.com/request.php
that the original page the request come from was mydomain.com/test.php?
I wish to ensure that the request can be done only from this exact page mydomain.com/test.php
and not from other domains nor page.
I do the request using ajax and javascript and therefore I think that I cannot add a hidden authentication that would ensure the whole thing is secure. Because each value is seen on the original page source code.