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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:07:59+00:00 2026-05-12T22:07:59+00:00

This is an odd question. I have a friend who is working on an

  • 0

This is an odd question. I have a friend who is working on an application. There is a table with 4 fields that holds a word and a definition among some other things. On a website there is a textbox in which a user can enter a string and the database is queried and looks for similar content while the string is being entered in the box. (A live search sort of thing).

Is there a security risk if whatever is being written is not actually being submitted like your regular site search? How would you validate the content at this time using regular expressions or the like?

As far as I know its being written in PHP and Javascript. Would you just have the Javascript validate before querying? or is it even necessary?

Thanks in advance! : )

  • 1 1 Answer
  • 1 View
  • 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-12T22:07:59+00:00Added an answer on May 12, 2026 at 10:07 pm

    There is always an inherent risk of malicious user input in regards to database queries. Take a quick look at this quick SQL Injection wikipedia entry to familiarize yourself with the topic.

    If you’re paranoid, you could whitelist characters in PHP using preg_replace() to remove any non-matching characters prior to querying.

    You should, with few exceptions, be using mysql_real_escape_string() on any and all user supplied variables being used in the query. Exceptions include decimal values which you can typecast using (int), (float), etc.

    As long as you aren’t using javascript to display the search text elsewhere on the page after submission of the input text, you shouldn’t need to do anything in regards to cross-site scripting (XSS) prevention.

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

Sidebar

Related Questions

This might be an odd question, but I have form in MVC3 that posts
So this might be an odd question, but I have a C# program that
I guess this is kind of an odd question but I have tried setting
This may seem like an odd question but I was talking to a friend
An odd question this will be, but here goes. I have a page on
this might be an odd question, but I have a map Long-String pair: 10
This may seem like an odd question, but I have my own reasons for
I understand this may sound like an odd question.. I have a repo on
I have an odd question that I have always thought about, but could never
I know that this question have been asked several times. But I can't get

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.