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

The Archive Base Latest Questions

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

I am not a professional web developer but I love web development as a

  • 0

I am not a professional web developer but I love web development as a hobby..
I am a student and I was asked to make a departmental event web site. I need to create HTML forms for user registration. I am aware of XSS Scripting attack and SQL Injection. But don’t know how they exactly work. I am using PHP and MySQL on server side.

I am taking in consideration:

  • Not to take empty values.
  • Verify that a number field is composed of integer values only.
  • Email ID verification. etc..

All this I am doing using RegEx check – both with javascript and PHP

Now my questions are:

  • What are all characters which I should not allow into my database?
  • Will it be okay if I convert < and > with their &lt; and &gt; alternatives?
  • What else should I consider while taking the input?

I don’t want to restrict users from inputting symbols which are harmless. So is there any particular set of character which I need to filter before storing the values into the database, so I can properly write regex checks for my form fields?

I have searched in google but was not able to find a proper answer. 🙁

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

    To prevent SQL injection, you should use the language’s escape function. For PHP, that’s mysql_real_escape_string. Or, better yet, use PDO to restrict what users can put into the DB.

    The HTML injection/XSS attack is different; you can store raw HTML in the database without issue, but before displaying any HTML originating with the user, call htmlspecialcharacters on it to prevent it from being interpreted by the client’s web browser.

    Do not code your own custom checks. You will miss something.

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

Sidebar

Related Questions

I am not a professional web developer, but I like to wrench on websites
I am not a professional web-developer but I am designing one to help out
I am not a professional web developer, however I dabbled in php in high
I'm not a professional, but I'm messing around with wordpress trying to customize it
First, let me say I'm not a professional programmer, but an engineer who had
According to Professional Javascript for Web developers array is not a datatype in Javascript:
I have used sql (mostly mysql) for years but not to a professional standard,
I'm very new to web development, have many years background on the desktop, but
First, my development environment: Win7 laptop with Visual Studio Professional 2010. IIS is NOT
I am not professional programmer so i can not be sure about this.How many

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.