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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:44:01+00:00 2026-05-16T07:44:01+00:00

If my site ever goes live (don’t think it will, its just a learning

  • 0

If my site ever goes live (don’t think it will, its just a learning exercise at the moment).

I’ve been using mysql_real_escape_string(); on data from POST, SERVER and GET.
Also, I’ve been using intval(); on strings that must only be numbers.

I think this covers me from sql injection? Correct? Can i do more?

But, I’m not sure how it provides (if it provides any protection at all) from XSS injection?

Any more information on how to combat these two forms of attacks is appreciated.

  • 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-16T07:44:02+00:00Added an answer on May 16, 2026 at 7:44 am

    I think this covers me from sql injection? Correct?

    No. It makes a terrible mess of your data.

    Can i do more?

    Yes. You can protect your code from SQL injections.
    Here is a brief explanation I’ve made already
    Only I have to add that you should not spoil your source data arrays.
    POST array has noting to do with SQL. The data may go into email, an HTML form, a file, online service, etc. Why treat it all with SQL protection?
    On the other hand, you may take your data not from POST but from a file, online service, other query.
    So, you have to protect not source arrays, but actual data that goes into query

    Speaking of XSS, there are no simple universal rule again.
    But in general, you have to use htmlspecialchars($data,ENT_QUOTES); for the every untrusted data you output as a text, and some other kinds of validations in some special cases, like filenames

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

Sidebar

Related Questions

I guess I have been using the Web Site model ever since .NET 2.0
I've finally completed a working version of my first ever CSS-supported site (thanks to
A site I'm working on has Flash headers (using swfobject to embed them). Now
A site I am working on that is built using PHP is sometimes showing
Site 1 has dll's for x amount of object and data calls. Can Site
My site has a drop-down menu built in CSS and JavaScript that drops down
My site has quite a deep navigation structure and quite often it looks like
What site(s) do you recommend for looking at complimentary colors for site design? It
Our site has multiple wizards where various data is collected over several pages, and
This site is pretty good but I'm wondering what other resources are out there.

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.