+ 1

saving emails in mysql with php and html

So I have never learned PHP and MySql before, but in this task I have to save inputed emails in Mysql database. Here is HTML and JS part https://code.sololearn.com/W7A14a12A2a2 And something I tried to do in PHP https://code.sololearn.com/wa7A17a3a210 So the question is-Can anyone please explain to me how to save these inputed emails, where are my mistakes, and help me with the code? Thank You for the help.

11th Jul 2021, 1:51 PM
Eric Kazhus
Eric Kazhus - avatar
5 odpowiedzi
0
In HTML: <form action="phpPart.php"...
11th Jul 2021, 7:16 PM
Václav Dostál
Václav Dostál - avatar
0
Vaclav I already have that it leads to different page, which is mandatory. Can I add another one?
11th Jul 2021, 7:20 PM
Eric Kazhus
Eric Kazhus - avatar
0
In PHP = phpPart.php (you can use any other name of PHP file): $email = $_Post['email']; $sql = "INSERT INTO table VALUES ('".$email."'); mysqli_query...
11th Jul 2021, 7:29 PM
Václav Dostál
Václav Dostál - avatar
0
WHERE table Is name of table in your database
11th Jul 2021, 7:30 PM
Václav Dostál
Václav Dostál - avatar
0
Eric : If you have valid form tag leading to your page , so in yourpage.php write INSERT etc. You can echoing The INSERT And try in phpmyadmin.
13th Jul 2021, 7:24 PM
Václav Dostál
Václav Dostál - avatar