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

  • SEARCH
  • Home
  • 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 153425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:47:55+00:00 2026-05-11T09:47:55+00:00

Is filter_var any good for filtering data? What kind of bad data will it

  • 0

Is filter_var any good for filtering data? What kind of bad data will it filter? I do use mysql_real_escape_string but I wonder if adding filter_var will help?

  • 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. 2026-05-11T09:47:56+00:00Added an answer on May 11, 2026 at 9:47 am

    To defend from SQL injection use prepared statements if possible. If not, use mysql_real_escape_string for strings, (int) casting or intval() for integers, (float) or floatval() for floats and addcslashes($input, ‘%_’) for strings to be used inside LIKE statements. Things get even more complicated when trying to escape strings to be used inside RLIKE statements.

    For filtering HTML content, the best would be strip_tags (without passing $allowable_tags), but… you may not like/want it, in which case the most affordable solution is:

    $escaped = htmlspecialchars($input, ENT_QUOTES, $your_charset); 

    A more reliable solution would be to use a library like HTML Purifier

    Filter functions are OK, but some of them are more validators than filters. Depending on your needs you may find some of them useful.

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

Sidebar

Related Questions

$.get($(this).attr('id'), function(data){ var qp_post = $(data).filter('title'); alert(qp_post); }); This fetches the content fine however
i filter the intent like this <intent-filter> <action android:name=android.nfc.action.NDEF_DISCOVERED/> <category android:name=android.intent.category.DEFAULT/> <data android:mimeType=text/plain />
I have yet to find a good example of how to use the php
I built a php script to output data posted in a form, but I
I know there is filter_var() but I don't want to validate a URL, I
I not any good at logic (math for a matter of fact). I am
i.m kind of confuse about this code if($filter_col!=null && $filter_val!=null) $filter = $filter_col.|.$filter_val; $prevpage
I am experimenting with filter_input and filter_var and I am currently trying to sanitize
In PHP, filter_var('www.example.com', FILTER_VALIDATE_URL) returns false . Is this correct? Isn't www.example.com a valid
Revised Code jQuery(function($) { $(#filter).keyup(function () { var filter = $(this).val(), count = 0;

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.