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 6773893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:43:19+00:00 2026-05-26T15:43:19+00:00

I created the add comment script. Source – if (isset($_GET[‘do’]) and $_GET[‘do’] == ‘comment’){//Ja

  • 0

I created the add comment script.

Source –

if (isset($_GET['do']) and $_GET['do'] == 'comment'){//Ja viss kārtībā, turpinam
                if (!empty($_POST['name']) and !empty($_POST['artcl_id']) and !empty($_POST['homepage']) and !empty($_POST['text'])){
                    $name = trim($_POST['name'],' ');
                    $artcl_id = trim($_POST['artcl_id'],' ');
                    $homepage = trim($_POST['homepage'],' ');
                    $text = trim($_POST['text'],' ');
                    Model::factory('index')
                            ->send_commentar(mysql_real_escape_string($name), mysql_real_escape_string($artcl_id), mysql_escape_string($homepage), mysql_real_escape_string($text), mysql_real_escape_string(time()));
                    ?>
                    <script type="text/javascript">
                        alert("Thank you! :)");
                    </script>
                    <meta http-equiv="REFRESH" content="0;url=/article/<?php echo $slug; ?>"/>
                    <?php

                } else {
                    $this->template->content = View::factory('index/error')->set('message', 'How to submit empty comment?');
                }
        }

But if I am putting white spaces in input field, the script send white spaces. Why the script don’t work correctly?

  • 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-26T15:43:20+00:00Added an answer on May 26, 2026 at 3:43 pm

    You’re removing whitespaces after you checked on empty fields. Don’t you want that turned around? First remove whitespaces and then checking for empty fields?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i already created a table for comments but i want to add the feature
I created a Word 2007 add-in project in C# that works fine on my
I created webservice which contain Add function as 'webmethod' when we want to deploy
I have created an Excel 2003 add-in that uses the CLR 2.0 and this
I have created a CustomAction feature to add a button to the Actions menu
I created a SDF (SQL CE) database with Visual Studio 2008 (Add / New
I've created a simple Outlook 2007 add-in using C# which loops through a selection
I am trying to add data to a newly created column... DataSet ds =
I am attempting to add some entities that I have created. When I try
Based on this example (which works): var Comment = new Schema(); Comment.add({ title :

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.