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. Study showing stars of varied ages can co-exist in open clusters, provides clue to stellar evolution in the Milky Way Galaxy
2. IACS Kolkata INSPIRE faculty’s work on Black Holes and Gravitational Waves to help understanding fundamentals of our nature
3. NCSTC, DST in association with Vigyan Prasar organized watching of Solar Eclipse live with solar filter spectacles in the campus
4. Detection of fluorine in hot Extreme Helium Stars solves their evolution mystery
5. DST-SERB supports study for identification of structure-based potential antivirals against COVID 19
6. IT Minister Launches National AI Portal of India- www.ai.gov.in
7. Chinese hackers attempt over 40,000 cyber-attacks in 5 days on India: Maha Police
8. Researchers find a new possibility to improve rice productivity
9. Live telecast of the solar eclipse has been arranged via Zoom, YouTube and Facebook
10. Prime Minister pays tributes to scientists on the National Technology Day
11. Aarogya Setu is now open source
12. 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
13. Certifying Quantum Entanglement: A step towards Quantum Security
14. The system has been certified for safety and performance by NABL accredited agencies and undergone stringent biomedical tests
15. NIT Kurukshetra Implements Enterprises Resource Planning (ERP), SAMARTH
16. Ministry of MSME Launches CHAMPIONS Portal www.Champions.gov.in
17. National Technology Day to be celebrated focusing on rebooting the economy through S&T
18. DRDO develops bio suit with seam sealing glue to keep health professionals fighting COVID-19 safe
19. Computer based nano materials by INST Mohali can show the future of nano-electronics
20. Scientists observe celestial smash-up around nearby star
21. Make a Free Website through Google Sites
22. AarogyaSetu: A multi-dimensional bridge
23. 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
24. AnyDesk Software
25. Top 5 Alternatives to the TikTok App
26. Top 20 Web Crawling Tools to Scrape the Websites Quickly
27. Buy Redmi 6 Pro starts from Rs.10999
28. Agricultural Technology Information Centre (ATIC)
29. Agricultural Technology Information Centre (ATIC)
30. nofollow : Concept and specification
31. BEST WAY TO COLLECT PAYMENTS ON YOUR WEBSITE
32. Php code for Comment on Webpage
33. Agricultural Technology Information Centre (ATIC)
34. OPPO R17 PRO : फ़ास्ट चार्ज होगी बैटरी
35. 9 Emerging Technologies to Lookout for in 2019
36. गूगल फोन पर भारी डिस्काउंट
37. Know about Search Engine Optimization
38. 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