Jump to content

Search the Community

Showing results for tags 'comment script'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hey all, I have some problems with this script when i post a comment and try to refresh page in Firefox it re-send data, but in Chrome and Opera is not re-send this is all in comments.php and i include it in other file <h4 class="h3-title">Comments</h4><small><?php if (!isset($_SESSION['username'])) { echo 'You must be looged in to post comments'; } ?></small> <hr /> <?php // list all comments if (isset($_GET['id'])) { $id = (int)$_GET['id']; $list_all_comments = $comments->list_comments($id); foreach ($list_all_comments as $comm) { echo '<i>' . $comm['comment_author'] . ' - <small>' . date('m F Y h.m.s', $comm['comment_date']) . '</small></i><br />'; echo '<p>' . $comm['comment_body'] . '</p><hr />'; } } // show comment form only for logged in users if (isset($_SESSION['username'])) { // process form data if (isset($_POST['comment'])) { if (isset($_GET['id'])) { $news_id = (int)$_GET['id']; $author = $_SESSION['username']; $body = trim(htmlentities($_POST['body'])); $date = time(); if (!empty($body)) { // add_comment($author, $body, $date, $news_id) $insert_comment = $comments->add_comment($author, $body, $date, $news_id); // refresh page after adding data echo '<meta http-equiv="refresh" content="0">'; } } } ?> <form action="" method="POST"> <textarea name="body" cols="75" rows="6" autofocus required></textarea><br /> <input type="submit" name="comment" value="Submit"> </form> <?php } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.