Click here to Skip to main content
14,427,983 members

displaying img in comment

Arun-23 asked:

Open original thread
hi frnds,

in below code it ill display comment box but it display only text.. hw to display img as well with the text in same format....
error_reporting(E_ALL ^ E_NOTICE);
$notify = "";
if(isset($_POST['notify_box'])){ $notify = $_POST['notify_box']; }
$dbLink = mysql_connect("localhost", "root", "");
    mysql_query("SET character_set_client=utf8", $dbLink);
    mysql_query("SET character_set_connection=utf8", $dbLink);
        $insert=mysql_query("INSERT INTO comment (name,comment) VALUES ('$name','$comment') ");
        echo "please fill out all fields";
$dbLink = mysql_connect("localhost", "root", "");
mysql_query("SET character_set_results=utf8", $dbLink);
$sql = "SELECT * FROM comment";
$getquery = mysql_query($sql);
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Comment box</title>
<style type="text/css">
body { margin: auto 48px; }
        <table id="commentTable">
                <col width="25%" />
                <col width="75%" />
while($row = mysql_fetch_array($getquery)) {
    echo '<td>' . $row['name'] . '</td>';
    echo '<td>' . $row['comment'] . '</td>';
    <form action="comment.php" method="POST">
            <col widht="25%" style="vertical-align:top;" />
            <col widht="75%" style="vertical-align:top;" />
                <td><label for="name">Name</label></td>
                <td><input type="text" name="name"/></td>
                <td><label for="comment">Comment:</label></td>
                <td><textarea name="comment" rows="10" cols="50"></textarea></td>
            <tr><td colspan="2"><input type="submit" name="submit" value="Comment"></td></tr>
Tags: PHP, MySQL


When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100