Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 890203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:41:33+00:00 2026-05-15T13:41:33+00:00

So I started to make comments module and came to conclusion that I’m not

  • 0

So I started to make comments module and came to conclusion that I’m not sure how to better do the comment submitting. This is the code I’ve for comment submitting form.

<form action="/rq/comment.php" method="post" id="pcomment" onsubmit="return rq('/rq/comment.php', 'pcomment');">
<input type="hidden" name="pid" value="<?=$id?>">
<div class="add">
    <div id="response" style="display:none;"></div>
    <div style="border: 1px solid rgb(204, 204, 204); -moz-border-radius: 5px 5px 5px 5px;">
        <textarea name="comment" rows="3" cols="50" style="border: 1px none transparent; width:98%;"></textarea>
    </div>
    <div style="display: block; overflow: hidden; margin-top: 5px;">
        <a href="#" class="cbutton btgreen" onclick="">
            <span>Comment</span>
        </a>
    </div>
</div>
</form>

First thing about which I wasn’t sure is how to better make the submit button. Like a simple input with type submit or to make the link to submit the form on click. Is there any difference from security view?

After the form is submitted rq() is called which does a jQuery $.post() serializing the form and calling the url passed in rq().

On server side I will do a spam protection checking if ~30 seconds have passed since last comment was added by this user. The comment will be added for the user who’s data is in session so I believe that replaces the token generating for form, or it doesn’t? The comment will be added for article who’s id is in hidden input field.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T13:41:33+00:00Added an answer on May 15, 2026 at 1:41 pm
    • submit button: You can use CSS to style the normal <input type="submit" value="Comment">, and it’s better to use this standard submit button for accesibility reasons etc.; also, some browsers can have problems submitting a form without a submit button
    • rq() – I assume you’re posting the form with AJAX, or normally if JS is disabled – looks OK
    • the server-side part also looks OK.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started learning how to make a module in perl with perltoot : package
I've recently started learning programming to make my own 3D OpenGL game on the
I have recently started a new C++ project and I intend to make it
I'm just getting started with jQuery. I was using it to make a photo
Hey, I need to make a HTTP POST request with an array of NSDictionary
ok, here we go... I have 3 tables: posts, comments and members, i need
It appears after much searching that there seems to be a common problem when
I was reading over http://android-developers.blogspot.com/2009/04/backward-compatibility-for-android.html But I'm really not grasping how to ignore certain
I started building a Universal app and it turned out the design doesn't work
I am deleting a column from one of the frequently used tables in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.