I have this code on javascript,
var path = 'remote site action.php';
var form = document.createElement("form");
form.setAttribute("method", 'POST');
form.setAttribute("action", path);
var code = "some info";
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", "data");
hiddenField.setAttribute("value", code);
form.appendChild(hiddenField);
document.body.appendChild(form);
form.submit();
Unfortunately I can’t post it to remote server. The code does its job but When I execute it, the remote page says access denied. (you do not have permission) (remote server/action.php). Should I change the permission param of the remote page?…any suggestions?
If you’re getting a 403 Access denied, then the problem is that the server doesn’t want anyone to see that page. If it’s your server, then try changing the permissions settings for that page. Cross domain shouldn’t be a problem if you’re submitting an HTML form.