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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:00:09+00:00 2026-06-08T18:00:09+00:00

Now I am using the following function to secure my strings : function secure($data)

  • 0

Now I am using the following function to secure my strings :

  function secure($data)
  {
    $data = trim($data);
    $data = htmlspecialchars($data);
    $data = str_replace("'", '"', $data);
    $search = array(chr(0xC2).chr(0xA0),chr(0xC2).chr(0x90),
                              chr(0xC2).chr(0x9D),chr(0xC2).chr(0x81),
                              chr(0xC2).chr(0x8D),chr(0xC2).chr(0x8F),
                              chr(0xC2).chr(0xAD),chr(0xAD));
    $data = str_replace($search, "", $data);
    return $data;
  }

Will this function be enought to secure strings?

Which methods will you use to secure your strings to insert into MySQL and to prevent bugs such as XSS in HTML page?

  • 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-06-08T18:00:11+00:00Added an answer on June 8, 2026 at 6:00 pm

    By saying ‘Secure my strings’ I am assuming you mean for output?

    For DB output (which includes varaibles used in SELECT queries), use *_escape_string functions or even better use prepared statements with PDO objects.

    For html output you should use htmlentities rather than htmlspecialchars

    Additionally if running shell commands from input use escapeshellarg and escapeshellcmd

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

Sidebar

Related Questions

I am altering the question now! I have the search working using the following:
I've drawn multiple 3d cubes objects using following function: gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertexCount); Now, I
Right now I'm using the following: export CFLAGS=-O2-isysroot/Developer/SDKs/MacOSX10.5.sdk -arch i386 -I/sw/include/ export LDFLAGS=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk,-L/sw/lib/ sudo
I'm using the following code to know a slider is now sliding or not.
I am using the following code to generate a Buy Now button for selling
So, for a while now I've been using the following to check if my
Ladies and Gentlemen, For quite a long time now, I've been using the following
Now I'm following one more friend and now I started to learn PLT Scheme(using
I am using git-svn with the following workflow now git clone <SVN TRUNK URL>
I'm using Joomla 1.5.14 and I configured SEO as in the following image Now

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.