Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to add a comment box on a web page using php?

<p><strong>Explain it in a brief or providing a source code for it is highly appreciable.</strong></p>

user-image
Question added by Prakash Adhikari , Computer Operator , Shree Sitala Devi Saving and Credit Co-operative Limited
Date Posted: 2014/12/15
DHANDAPANI RAMAMOORTHY
by DHANDAPANI RAMAMOORTHY , Web Developer / UI Designer , coimbatore

<html>

<head>

<metahttp-equiv="Content-Type"content="text/html; charset=utf-8"/>

<title>Comment box</title>

</head>

<body>

<center>

<formaction="commentindex.php"method="POST">

<table>

<tr><tdcolspan="2">Comment: </td></tr>

<tr><tdcolspan="5"><textareaname="comment"rows="10"cols="50"></textarea></td></tr>

<tr><tdcolspan="2"><inputtype="submit"name="submit"value="Comment"></td></tr>

</table>

</form>

<?php

mysql_connect("mysql host name","mysql user name","mysql password");

mysql_select_db("database name");

$comment=$_POST['comment'];

$submit=$_POST['submit'];

$dbLink=mysql_connect("host name", "mysql username", "mysql password");

if($submit)

{

if($name&&$comment)

{

$insert=mysql_query("INSERT INTO comment (comment) VALUES ('$comment') ");

echo"added success";

}

else

{

echo"please fill out all fields";

}

}

?>

</body>

</html>

hi njfjsjf sjndfjskn dknsadnskdn sndjsndsndnskjdnkasndks dnskdnksndnsdkdjsndjsndkjnskjndnj

More Questions Like This