Skip to Content
PHPCODE
Code Comment System with Ajax, PHP & MySQL
php code / September 8, 2018

Step by Step :-
Step 1: Created database and database name is comm
Step 2 : Created Table in SQL QUERY This

CREATE TABLE `comment` (
`id` int(11) NOT NULL,
`parent_id` int(11) NOT NULL,
`comment` varchar(200) NOT NULL,
`sender` varchar(40) NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE `comment`
ADD PRIMARY KEY (`id`);

ALTER TABLE `comment`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
COMMIT;

Step 3 : Created header.php File

<!DOCTYPE html>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css”>
<link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css”>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js”></script>
<script src=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js”></script>
<!– jQuery –>

Step 4 : Created footer.php File
<div class=”insert-post-ads1″ style=”margin-top:20px;”>
</div>
</div>
</body></html>
Step 5 :Created container.php File
</head>
<body class=””>
<div role=”navigation” class=”navbar navbar-default navbar-static-top”>
      <div class=”container”>
        <div class=”navbar-header”>
          <button data-target=”.navbar-collapse” data-toggle=”collapse” class=”navbar-toggle” type=”button”>
            <span class=”sr-only”>Toggle navigation</span>
            <span class=”icon-bar”></span>
            <span class=”icon-bar”></span>
            <span class=”icon-bar”></span>
          </button>
          <a href=”https://phpcodeinfomation.blogspot.com/p/php-script.html” class=”navbar-brand”>PHPCODE</a>
        </div>
        <div class=”navbar-collapse collapse”>
          <ul class=”nav navbar-nav”>
            <li class=”active”><a href=”https://phpcodeinfomation.blogspot.com/p/php-script.html”>Home</a></li>
          </ul>
        </div><!–/.nav-collapse –>
      </div>
    </div>
<div class=”container” style=”min-height:500px;”>
<div class=”>
</div>
Step 6 :Created index.php File
<?php
include(‘header.php’);
?>
<title>phpcode : Code Comment System with Ajax, PHP & MySQL</title>
<script src=”js/comments.js”></script>
<?php include(‘container.php’);?>
<div class=”container”>
<h2>Example: Comment System with Ajax, PHP & MySQL</h2>
<br>
<form method=”POST” id=”commentForm”>
<div class=”form-group”>
<input type=”text” name=”name” id=”name” class=”form-control” placeholder=”Enter Name” required />
</div>
<div class=”form-group”>
<textarea name=”comment” id=”comment” class=”form-control” placeholder=”Enter Comment” rows=”5″ required></textarea>
</div>
<span id=”message”></span>
<br>
<div class=”form-group”>
<input type=”hidden” name=”commentId” id=”commentId” value=”0″ />
<input type=”submit” name=”submit” id=”submit” class=”btn btn-primary” value=”Post Comment” />
</div>
</form>
<br>
<div id=”showComments”></div>
</div>
<?php include(‘footer.php’);?>
Step 7 : Created comments.php File
<?php
include_once(“db_connect.php”);
if(!empty($_POST[“name”]) && !empty($_POST[“comment”])){
$insertComments = “INSERT INTO comment (parent_id, comment, sender) VALUES (‘”.$_POST[“commentId”].”‘, ‘”.$_POST[“comment”].”‘, ‘”.$_POST[“name”].”‘)”;
mysqli_query($conn, $insertComments) or die(“database error: “. mysqli_error($conn));
$message = ‘<label class=”text-success”>Comment posted Successfully.</label>’;
$status = array(
‘error’  => 0,
‘message’ => $message
);
} else {
$message = ‘<label class=”text-danger”>Error: Comment not posted.</label>’;
$status = array(
‘error’  => 1,
‘message’ => $message
);
}
echo json_encode($status);
?>
Step 8 : Created db_connect.php File
<?php
/* Database connection start */
$servername = “localhost”;
$username = “root”;
$password = “”;
$dbname = “comm”;
$conn = mysqli_connect($servername, $username, $password, $dbname) or die(“Connection failed: ” . mysqli_connect_error());
if (mysqli_connect_errno()) {
    printf(“Connect failed: %sn”, mysqli_connect_error());
    exit();
}
?>
Step 9 : Created show_comments.php File
<?php
include_once(“db_connect.php”);
$commentQuery = “SELECT id, parent_id, comment, sender, date FROM comment WHERE parent_id = ‘0’ ORDER BY id DESC”;
$commentsResult = mysqli_query($conn, $commentQuery) or die(“database error:”. mysqli_error($conn));
$commentHTML = ”;
while($comment = mysqli_fetch_assoc($commentsResult)){
$commentHTML .= ‘
<div class=”panel panel-primary”>
<div class=”panel-heading”>By <b>’.$comment[“sender”].'</b> on <i>’.$comment[“date”].'</i></div>
<div class=”panel-body”>’.$comment[“comment”].'</div>
<div class=”panel-footer” align=”right”><button type=”button” class=”btn btn-primary reply” id=”‘.$comment[“id”].'”>Reply</button></div>
</div> ‘;
$commentHTML .= getCommentReply($conn, $comment[“id”]);
}
echo $commentHTML;
function getCommentReply($conn, $parentId = 0, $marginLeft = 0) {
$commentHTML = ”;
$commentQuery = “SELECT id, parent_id, comment, sender, date FROM comment WHERE parent_id = ‘”.$parentId.”‘”;
$commentsResult = mysqli_query($conn, $commentQuery);
$commentsCount = mysqli_num_rows($commentsResult);
if($parentId == 0) {
$marginLeft = 0;
} else {
$marginLeft = $marginLeft + 48;
}
if($commentsCount > 0) {
while($comment = mysqli_fetch_assoc($commentsResult)){
$commentHTML .= ‘
<div class=”panel panel-primary” style=”margin-left:’.$marginLeft.’px”>
<div class=”panel-heading”>By <b>’.$comment[“sender”].'</b> on <i>’.$comment[“date”].'</i></div>
<div class=”panel-body”>’.$comment[“comment”].'</div>
<div class=”panel-footer” align=”right”><button type=”button” class=”btn btn-primary reply” id=”‘.$comment[“id”].'”>Reply</button></div>
</div>
‘;
$commentHTML .= getCommentReply($conn, $comment[“id”], $marginLeft);
}
}
return $commentHTML;
}
?>
Comments

Hi there, MegaCool blog mate, I really loved this page. I’ll be sure to talk about this to my cousin who would, odds are, love to check out this post too. Found this sites post through the Bing search engine by the way, incase you were curious. Many thanks for the wonderful read!

Safarmtrery says:

Добро пожаловать в интернет-аптеку FARMA-MOS.RU – аптека для тех, кто хочет сделать свою сексуальную жизнь более насыщенной!

У нас вы можете [url=https://farma-mos.ru/]виагра купить в москве в аптеке[/url] быстро и анонимно, ведь даже курьер не будет знать, что везет вам! Но это далеко не весь ассортимент, помимо таблеток для мужской потенции у нас есть средства для продления полового акта и улучшения тактильных чувств.

Для мужчин огромный выбор недорогих, но проверенных и качественных препаратов, однако и девушек мы не обошли стороной! Для них в нашем магазине также есть [url=https://farma-mos.ru/]виагра для мужчин купить в аптеке[/url] и возбудители, смазки и конечно препараты для действительно шикарного удовольствия от полового акта.

NikavoTak says:

Портфельный управляющий УК «Открытие» Руслан Мустаев заявил, что курс рубля укрепляется благодаря ряду политических и экономических причин. Однако есть факторы, из-за которых национальная валюта может ослабнуть, передает «Прайм».

Экономист назвал условия для возможного ослабления рубля и исключил, что Банк России позволит падение доллара ниже 50 рублей, поскольку это способно подорвать конкурентоспособность страны. По его мнению, существует несколько методов борьбы с укреплением валюты.

В первую очередь, следует обратить внимание на валютную интервенцию, при которой валюты «дружественных» государств меняют доллар через кросс-курсы. Однако такой способ грозит ростом инфляции в России. Мустаев также предложил дать экспортерам гарантии для сохранения рубля в стране. Для полной стабилизации курса следует возобновить импортные потоки.

Такие новости на сегодня, а если вы сейчас в поисках качественных и фирменных кроссовок – тогда мы советуем вам посетить сайт нашего партнера! Переходите по ссылке [url=https://justnike.ru/]найк москва[/url] где вы сможете купить кроссовки Найк по дисконт ценам.

JancomCix says:

Доброго времени суток! Хочу рассказать вам про официальный интернет-магазин сумок Marc Jacobs, на котором вы сможете купить себе стильную и качественную сумку к осеннему сезону.

Переходите на страницу [url=https://marcjacobs-russia.com/]марк якобс[/url] где собраны все новинки легендарного бренда Marc Jacobs, кстати именно сейчас до 20 сентября скидки 30% на все женские сумки и рюкзаки.

Посмотрите весь ассортимент товара и выбирайте именно то, что вам по душе и стилю! Также при покупку двух женских сумочек – третью вы получаете в подарок!

Patrickhit says:

Beware of Greeks bearing gifts Link to proverb.
https://spirifij375.net
Fool and his money are soon parted – A.
If you build it they will come.
Two is company, but three’s a crowd.
Husband is always the last to know – The.
Adversity makes strange bedfellows Link to proverb.
If a job is worth doing it is worth doing well.

NesanyNug says:

Лодки с мотором купить draiv38.ru

Мотосалон Драйв представляет огромный каталог надувных лодок, запчастей и аксессуаров с доставкой и Иркутске и не только. Осуществляем работу напрямую с поставщиками и являемся основным дилером популярных отечественных и зарубежных фирм. Все товары имеют настоящие сертификаты и гарантию от одного года.

По теме [url=https://draiv38.ru/catalog/lodochnye-motory]купить лодочный мотор в иркутске[/url] мы Вам с радостью поможем. Заходите на веб портал draiv38.ru и смотрите наш каталог товаров. Товары разделены на категории: гребные винты, насадки водометные, для подвесных моторов, надувные лодки ПВХ, аксессуары для лодок, оборудование для катеров и яхт, фурнитура для тентов, алюминиевые лодки, мотобуксировщики и другие. Также возможно найти необходимый товар по названию бренда или просто напечатав в строку поиска. Если Вы не представляете, что Вам именно нужно, обращайтесь к нашим консультантам, которые Вас проинформируют и помогут сделать верный выбор. Либо отправьте Ваш запрос в форме обратной связи и Вам дадут на него ответ.

Если Вы искали [url=https://ulan-ude.draiv38.ru/catalog/naduvnye-lodki?tip=tip-grebnaya]гребные лодки пвх[/url] в интернете, то Вы не правильном пути. Оплата происходит в наших магазинах, а также на расчетный счет или карту. Доставка товара происходит регулярно в рабочие дни. Уточнить подробнее можно при оформлении заказа о цене и времени доставки.

Один из наших магазинов находится по адресу: г. Иркутск, ул. Трактовая, д. 18, стр. 5. Режим работы с пн по пт с 10:00 до 18:00, в сб и вс с 10:00 до 16:00. Позвоните по контактному телефону +7(902)577-90-45 и задавайте все возникшие вопросы. Если Вы что-либо не нашли на сайте, мы можем оформить заказ от поставщика специально под Ваш запрос.

For the first time I became interested in sex toys at the age of 19-20. After graduation, I worked a little and got the opportunity to pamper myself. Moreover, there was no relationship then, and sex too … Around the same time, there was the first visit to the sex shop – a very exciting event! I decided more than a month, and until the last https://self-lover.store/sredstva-dlya-lateksa/ I doubted, but the desire to experience something “special” still overpowered. I remember I was very excited at the mere thought that I would have to walk and look, tell the sellers what you want to buy, and how they would look at you after that … After a month of doubts, I still came. Half an hour looking for the entrance to the sex shop. I walked around the building 10 times, but there was no sign of the entrance. Just a residential building with a few shops – no signs, no signs, nothing at all. And the entrance was inside one of the usual shops. Well camouflaged. Later, a sign was also found – small, modest and completely inconspicuous.
The sex shop had a nice atmosphere, dim lights and no one but 2 male salespeople. The room was divided into several thematic parts. The first had only sex toys https://self-lover.store/dlya-par/ , the second was all for role-playing, and the third was erotic lingerie. Walked and looked. Not to say that he was very shy, but he still experienced a certain tension.
https://self-lover.store/nasadky-na-chlen/
For the first time I took a few toys:
1. A simple vagina (masturbator). It was unpleasant to use without a condom (albeit with lubrication) due to the hard internal relief. If with a condom, then everything is fine. But the orgasm came too fast, so it wasn’t very interesting. In general, it felt no different from the usual strong hand grip on the cock.
2. Small anal vibrator. In principle, he became a favorite toy during masturbation, he always finished with him very hard. During orgasm, he slipped out of the ass, so you had to hold him or not use lubricant. Then I noticed that if, after ejaculation, you insert it into yourself again, then a second erection occurs much faster. By the way, it was after meeting with the vibrator that I realized what the secret of the prostate is, and that it stands out from its stimulation.
3. Small butt plug. I liked to put it on the edge of the table and sit down ass. At first, just sit and get high, move a little – the erection was iron, lubricant was constantly emitted from the penis. But still, it didn’t work https://self-lover.store/smazki-dlya-muzhchin/1242/ out from sex toys (without penis stimulation).
Then there were new toys:
4. Tried a full dildo first (no vibration). https://self-lover.store/vkusovye-oralnye/ I was attracted to it by its appearance – beautiful, delicate material, pleasant to touch, but it turned out to be too large (4 cm thick). After several uses, I realized that the experiments with large toys are over.
5. Then came a small anal dildo on a suction cup – thin, curved, hard, with a relief head. I’ve had a lot of fun with him. I attached it on the table, and on the wall in the bathroom, and in the position of a rider in bed … Most of all I liked to sit on it and sway at a slow pace for 20-30 minutes (without touching the penis). I liked it more than the orgasm itself.
6. There were also several prostate massagers. Moreover, both very inexpensive and top … Advertising, as always, lied – not a single such massager can replace a living finger. There is something to compare with in this regard … It’s nice, of course, and there weren’t any massagers, but it didn’t work out from them (without penis stimulation). But from the female finger finished.
7. There were anal beads and chains. Also amusing toys, but completely useless. Compared to vibrators, it’s somehow completely uninteresting.
8. Realistic vagina (masturbator) also turned out https://self-lover.store/smazki-dlya-masturbatorov/1241/ to be a complete marketing bullshit. And it doesn’t even look like real sex. Don’t get fooled!
After 2-3 years of experiments, I realized that I was wasting my money. Not that I really regret it, after all, this is a certain sexual experience, but I realized one thing – in my relationship, these things are clearly superfluous. In sex, I like to caress, touch, hug, talk… And all these toys https://self-lover.store/probniki/1240/ simply distract and interfere. You’re shifting responsibility from your hands and dick to a piece of plastic. So uninteresting…
When there was no sex for more than a year, there was no desire to take up toys again. More interested in relaxing and erotic massage. Not all sorts of salons, but personal acquaintances. It is much more pleasant to spend time with a living person than with a piece of plastic. Then for some time there was an opportunity to practice erotic massage. After that, I realized that sex toys are something so primitive compared to what you can do with your https://self-lover.store/lubrikanty/ own hands, that this is really what is called “the industry is fed.” But “experience is the son of difficult mistakes”, and apparently it was necessary to go through this in order to understand. Not a penny of the sex industry! A living person is everything. Plastic is nothing.

AshCiz says:

[url=https://arimidexpill.com/]how to get arimidex[/url]

UgoCiz says:

[url=http://ulasix.com/]lasix water pills for sale[/url]

WimCiz says:

[url=https://arimidexpill.com/]where to buy arimidex online[/url]

UgoCiz says:

[url=http://flomaxtab.com/]flomax cataract surgery[/url]

BooCiz says:

[url=http://colchicinex.com/]colchicine over the counter canada[/url]

UgoCiz says:

[url=http://suhagratabs.com/]suhagra without prescription[/url]

WimCiz says:

[url=https://lisinoprilo.com/]rx drug lisinopril[/url]

KiaCiz says:

[url=http://fluoxetine.company/]120 mg fluoxetine[/url]

DavidTah says:

[url=http://vermox.ink/]vermox for sale uk[/url]

Josephspide says:

[url=https://doxycyclinepm.online/]cost doxycycline tablets[/url]

AlanCiz says:

[url=http://cafergot.best/]cafergot tablet[/url]

Josephspide says:

[url=https://atenolola.online/]atenolol 50 prescription[/url]

AshCiz says:

[url=http://sildenafilkamagra.shop/]sildenafil 20 mg online rx[/url]

Leave a Reply

Your email address will not be published.

PHPCODE © 2023