Php code for Comment on Webpage #educratsweb
HOME | LATEST JOBS | JOBS | CONTENTS | STUDY MATERIAL | CAREER | NEWS | BOOK | VIDEO | PRACTICE SET REGISTER | LOGIN | CONTACT US
Post Jobs or Post Contents BIHAR STATE POLLUTION CONTROL BOARD RECRUITMENT OF J.R.F UNDER NAMAMI GANGE PROGRAMME | Online Recruitment Applications (ORA) are invited by Himachal Pradesh (HP) Public Service Commission (PSC) from desirous and eligible candidates for recruitment to the following Govt. Job | Recruitment of IT Professionals in Rites | BSNL Recruitment of Management Trainee Telecom Operations | SAVEETHA INSTITUTE Of MEDICAL AND TECHNICAL SCIENCES | Assistant Professor Medical Recruitment by Himachal PSC | Jobs in Delhi Public School : Dimapur (Nagaland) | SYMBIOSIS UNIVERSITY OF APPLIED SCIENCES, (SUAS) | Add your Article

Php code for Comment on Webpage

Posted By educratsweb.comTechnology 🗓 Wednesday September 19 2018 👁 138


Php code for Comment on Webpage

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. 


RELATED POST

Buy Redmi 6 Pro starts from Rs.10999
Know about Search Engine Optimization
Php Code for View, Search, Edit and Delete Record from MySql Table
Php code example for Secure login
HTML – Hyper Text Markup Language
Send E-mail to Multiple Person(E-mail) with Php
Php code for Comment on Webpage
Php code for Online Quiz
nofollow : Concept and specification
Dual WhatsApp
OPPO R17 PRO : फ़ास्ट चार्ज होगी बैटरी




Disclaimer: we only provide job information. we are not associated with any job website. Although we take extreme care for accuracy of the information provided, but you must check the authenticity of the website before applying for the job. We are not responsible for your operation , once you leave our website and apply thereafter. Please recheck the genuineness of the job website from yourself also.

Copyright © 2018. Website template by WebThemez.com