POST or GET requests to php script not working

http://zaslonipuk.epizy.com/test.php

Hi I am new to all this and I hope you can help me, thanks in advance. I was sending GET and POST requests with python requests library and I get code 200, but script doesn’t run. But, when I type url in browser script runs.

Python code:

import requests
#userdata = {“api_key”: “tPmAT5Ab3j7F9”, “value1”: “1124”}
resp = requests.get(‘http://zaslonipuk.epizy.com/test.php’)

print(resp)

PHP script:

<?php if (isset($_POST)){ $myfile = fopen("post.txt", "w") or die("Unable to open file!"); $txt = "John Doe\n"; fwrite($myfile, $txt); fclose($myfile); } else{ $myfile = fopen("get.txt", "w") or die("Unable to open file!"); $txt = "John Doe\n"; fwrite($myfile, $txt); fclose($myfile); } ?>

I’m using this software:

Additional information:

I already altered my PHP config to display errors. I am on free account.

1 Like

https://infinityfree.net/support/javascript-error-using-api-or-mobile-android-app/

4 Likes

I thought that python isn’t supported.

Python doesn’t run on our hosting, which means it must run elsewhere. And if you’re trying to do programmatic access from elsewhere to a PHP script hosted here, then you run into the system which BayoDino linked to.

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.