I tried requests module but I've error in my php outputs: The error is: Notice: Undefined index: firstname in D:\xampp\htdocs\myfile\receive.php on line 7 NULL
code in python:
'''
payload = {'firstname':'Jack'}
url = "http://localhost/myfile/receive.php"
resp = requests.post(url, data=payload)
print(resp.status_code)
text =resp.text
print(text)
'''
status_code is ok(200)!
php code:
$data = $_POST["firstname"];
var_dump($data);
It seems okay but it's not :)
'array(1) { ["firstname"]=> string(4) "jack" } '
but my browser shows me: ' array(0) { }' – joker_007 Sep 23 '21 at 03:48
the output in python was:' string(4) "jack" ' but in browser : There is nothing to show! – joker_007 Sep 23 '21 at 03:54