+ 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.
5 Respostas
0
In HTML:
<form action="phpPart.php"...
0
Vaclav I already have that it leads to different page, which is mandatory. Can I add another one?
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...
0
WHERE table Is name of table in your database
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.