How to fill out a form using Python3 and send the data in the database?

Need to send the data to a form on the website using the requests library. Then, the resulting data is recorded in a table in a database.
Here is the form code:
<form action method="post">

<label>Username</label>
 <input name="login" id="login" type="text"><br>
<label>Password</label>
 <input name="password" id="password" type="password"><br>
 </form>

Here is the php code:
if ($_SERVER["REQUEST_METHOD"] == "POST"){

 $login = $_POST["login"];
 $password = $_POST["password"];

 $mysqli = new mysqli ("url.ru","user","password","table");
 $mysqli->query("SET NAMES 'utf8'");

 $succ = $mysqli->query("INSERT INTO `auth`(`login`,`password`) VALUES ($login,$password)");

 echo $succ;
 $mysqli->close();

Here's python code.
import requests
data = {'login':'test', 'password':'test'}
url = 'url.ru'
requests.post(url, data)

The problem is that python fills in the form, php starts processing the data(you can see if python's request to enter into a variable and then see the result in content),but the data in the database table is not sent. If the same thing be done in the browser(to enter data into the form), all successfully written to the table. Why is this happening and what can I try?

p.s. Use the necessary requests
June 3rd 19 at 21:01
0 answer

Find more questions by tags PHPHTMLPythonSQL