How to make the data that the user write it in textbox in html web go to data table in php my admin? Please write the code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to make the data that the user write it in textbox in html web go to data table in php my admin? Please write the code

6th Mar 2017, 3:10 AM
Kirollos Ayman
3 Answers
+ 5
index.html <form action="processdata.php" method="post"> <input type="text" name="info"> <button type="submit">Send data</button> </form> processdata.php // get the data $info = filter_input(INPUT_POST, 'info', FILTER_SANITIZE_SPECIAL_CHARS); // db connection $host = "localhost"; $dbname = "test"; $user = "root"; $pass = "password"; $conn = new PDO("mysql:host=$host;dbname=$dbname","$user","$pass"); // statement $stmt = $conn->prepare("INSERT INTO test (column_name) VALUES (?)"); $stmt->bind_param("s", $info); $stmt->execute();
6th Mar 2017, 3:44 AM
Patrik Sokol
Patrik Sokol - avatar
+ 4
You are welcome. Do you need some explanation of the code or any other help with processing data?
6th Mar 2017, 9:17 AM
Patrik Sokol
Patrik Sokol - avatar
+ 3
thanks for your answer
6th Mar 2017, 9:08 AM
Kirollos Ayman