Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,668 members, 7,955,418 topics. Date: Sunday, 22 September 2024 at 04:45 AM |
Nairaland Forum / Science/Technology / Webmasters / How To Code Comment Box With PHP And Mysql (305 Views)
Help Me Add Comment Box To Sevida Template / Top 5 Comment Box Systems Bloggers Can Use (2) (3) (4)
(1) (Reply)
How To Code Comment Box With PHP And Mysql by codelove: 7:33am On May 11, 2017 |
i am developing a comment box with php and mysql,but my problem now is how to post the comment after user has enter their comment.so far i my php and mysql that save the comment in the database,but i want it to be visible on my webpage after it is save to database,i don't know the code for that,i need help. [CODE] <!DOCTYPE html> <html> <head> <title> commenting system </title> </head> <body> <form action = "cm.php" method = "POST"> <input type = "text" name = "fname" placeholder = "Name"><br><br> <input type = "text" name = "website" placeholder = "website"><br><br> <textarea type = "text" name = "scomment" rows = "6" col = "250" placeholder = "comment here...."> </textarea> <button type = "submit">SUBMIT</button> </form> </body> </html> cm.php <?php include 'db.php'; $fname = $_POST['fname']; $website = $_POST['website']; $scomment = $_POST['scomment']; $sql = "INSERT INTO client (fname, website, comment) VALUES ('$fname', '$website', '$scomment')"; $result = $con->query($sql); header("Location:index.php" ?> db.php <?php $con = mysqli_connect("localhost", "root", "", "comment" if(!$con){ die("connection error".mysqli_connect_error()); } [/CODE] |
(1) (Reply)
Need An E-commerce Site For Your Business...don't Bother Join Shopsportfolio / Get Premuim Hosting For Free 100% Free / 2 SEO Factors That Will Skyrocket Your Blog Rankings
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8 |