Hello guys I'm having problems with calling a python script through my website, either using PHP or AJAX
All my stuff, html, php, css and .py are in the same folder /var/www/html/
JS:
document.getElementById('print').onclick = function(){Print()};
function Print() {
var param = 'zya';
$.ajax({
type: 'POST',
url: '../degaps1.py',
data: {param: param},
success: function(response){
output = response;
alert(output);
}
});
Python:
degaps1.py
import cgi
import cgitb; cgitb.enable()
print "Content-Type: text/html"
print ""
arguments = cgi.FieldStorage()
print "test"
When I was using the "url" without "../" it was printing the entire code, now I get a message in the console... 403 Forbidden. What can I do to fix it?. Thanks in advance!
If I'm not wrong, the output in the alert should be "test".