Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

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 ajoutée par Prakash Adhikari , Computer Operator , Shree Sitala Devi Saving and Credit Co-operative Limited
Date de publication: 2014/12/15
DHANDAPANI RAMAMOORTHY
par 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