educratsweb logo


Php code for Comment on Webpage

 

$Yourwebpage.php

 

 

<!-- Comment Entry Section  !-->

    <table cellpadding="0" cellspacing="0"><tr>

      <td width="25%" valign="top"><form method="post" action="<? echo $pfile;?>" name="comment">

          <table bgcolor="silver" align="center" cellpadding="5" cellspacing="0" width="270px">

            <tr>

              <th colspan="2"><? if($_POST["do_comment"]==1) {

                                        $name=$_POST["name"];

                                        $email=$_POST["email"];

                                        $website=$_POST["website"];

                                        $comment=$_POST["comment"];

                                        $page=$_POST["page"];

                                        $status=0;

                                        $page=$_post["page"];

                                        $query="insert into comment values('$name','$email','$website','$comment',$status,'$pfile')";

                                        $result=mysql_query($query);

                                        if($result!=NULL)

                                            echo "<font color='red'>Thanks for your comment ; Your comment need approval after approval it will be display on website.</font><br>";

                                    }

                                    ?>

                <? $file = $_SERVER["SCRIPT_NAME"];

                                    $break = Explode('/', $file);

                                    $pfile = $break[count($break) - 1];

                                    ?>

                Write your comment</th>

            </tr>

            <tr>

              <td>Enter Your Name</td>

              <td><input type="text" size="20" name="name" /></td>

            </tr>

            <tr>

              <td>Enter Your Email</td>

              <td><input type="text" size="20" name="email" /></td>

            </tr>

            <tr>

              <td>Enter Your Blog</td>

              <td><input type="text" size="20" name="website"  value="http://"/></td>

            <tr>

              <td colspan="2">Enter Your Comment</td>

            </tr>

            <tr>

              <td colspan="2" align="center"><textarea rows="5" cols="25" wrap="virtual" name="comment"></textarea></td>

            </tr>

            </tr>

            <tr>

              <td colspan="2" align="center"><input type="hidden" name="do_comment" value="1" />

                <input type="hidden" name="page" value="<? echo $pfile; ?>" />

                <input type="submit" value="Submit" />

                <input type="reset" value="Clear" /></td>

            </tr>

          </table>

        </form>

                       

                        </td>

      <td valign="top"><!-- Comments Display Section  !-->

          <div id="comment">

            <center>

              <b>Comment on <? echo $pfile; ?></b>

            </center>

            <br />

            <?

                        $query="select * from comment where page='$pfile' and status='1'";

                        $result=mysql_query($query);

                        $temp=0;

                        while ($row = mysql_fetch_array($result)) {

                            $temp=1;

                            if($row[2]==NULL || $row[2]=="http://")

                                echo "<b>",$row[0]," (",$row[1],") </b><i>Wrotes</i> <b>",$row[3]," </b><hr>";

                            else

                                echo "<a target='_blank' href='",$row[2],"'><b>",$row[0],"</a> (",$row[1],")</b><i> Wrotes </i><b>",$row[3],"</b><hr>";

                        }

                        if($temp==0)

                            echo "<i>No comment on this section</i>";

 

                        ?>

          </div>

                         <div align="right" style="padding:5px;" ><a href="comment.php" style="color:#0000FF">View All</a></div>

</div>

</center>

 

                          </td>

      </tr></table>

 

 

Table of Enquiry

 

CREATE TABLE `comment` (  `name` varchar(20) NOT NULL default '',  `email` varchar(40) default NULL,  `blog` varchar(40) default NULL,  `comment` text,  `status` tinyint(1) default '0',  `page` varchar(20) default NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;

 

 

Comment will be Display on web page when status will be 1. So create admin section to change or alter the Data of comment posted by the user or you can store 1 when you don't need of authorization required. 

Php code for Comment on Webpage
Contents shared By educratsweb.com

if you have any information regarding Job, Study Material or any other information related to career. you can Post your article on our website. Click here to Register & Share your contents.
For Advertisment or any query email us at educratsweb@gmail.com

RELATED POST
1 IT Minister Launches National AI Portal of India- www.ai.gov.in
2 DST-SERB supports study for identification of structure-based potential antivirals against COVID 19
3 Researchers find a new possibility to improve rice productivity
4 To deal with COVID-19, CIPET to take up R&D initiatives in the areas of Health Care; manufacturing and Certifying PPE and other relevant products as per WHO/ ISO guidelines
5 Aarogya Setu is now open source
6 Certifying Quantum Entanglement: A step towards Quantum Security
7 Prime Minister pays tributes to scientists on the National Technology Day
8 The system has been certified for safety and performance by NABL accredited agencies and undergone stringent biomedical tests
9 Ministry of MSME Launches CHAMPIONS Portal www.Champions.gov.in
10 NIT Kurukshetra Implements Enterprises Resource Planning (ERP), SAMARTH
11 National Technology Day to be celebrated focusing on rebooting the economy through S&T
12 DRDO develops bio suit with seam sealing glue to keep health professionals fighting COVID-19 safe
13 Scientists observe celestial smash-up around nearby star
14 Make a Free Website through Google Sites
15 Computer based nano materials by INST Mohali can show the future of nano-electronics
16 Raksh is a 360-degree proximity detection device that senses other users within its proximity and sounds a warning as soon as another device comes within its defined range
17 AarogyaSetu: A multi-dimensional bridge
18 Top 5 Alternatives to the TikTok App
19 AnyDesk Software
20 Top 20 Web Crawling Tools to Scrape the Websites Quickly
21 Buy Redmi 6 Pro starts from Rs.10999
22 Agricultural Technology Information Centre (ATIC)
23 Agricultural Technology Information Centre (ATIC)
24 BEST WAY TO COLLECT PAYMENTS ON YOUR WEBSITE
25 nofollow : Concept and specification
26 Php code for Comment on Webpage
27 Agricultural Technology Information Centre (ATIC)
28 OPPO R17 PRO : फ़ास्ट चार्ज होगी बैटरी
29 9 Emerging Technologies to Lookout for in 2019
30 गूगल फोन पर भारी डिस्काउंट
31 Know about Search Engine Optimization
32 Send E-mail to Multiple Person(E-mail) with Php
We would love to hear your thoughts, concerns or problems with anything so we can improve our website educratsweb.com ! visit https://forms.gle/jDz4fFqXuvSfQmUC9 and submit your valuable feedback.
Save this page as PDF | Recommend to your Friends

http://educratsweb(dot)com http://educratsweb.com/content.php?id=54 http://educratsweb.com educratsweb.com educratsweb