I'm having trouble while sending data to PHP script through python
if i try with browser then data is posting but if i try with python script it is not posting any data and no error is shown
i have tried using headers, get instead of post
PHP:
$q = @$_GET['q'];
if($q) {
$sql = "INSERT INTO data VALUES ('', '".$q."')";
if (mysqli_query($conn, $sql)) {
echo "Posted";
} else {
echo "cannot post";
}
}
PYTHON:
import requests
payload = {'q': 'some-data'}
r = requests.post('http://example.com/store.php', params=payload)