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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:37:06+00:00 2026-06-17T06:37:06+00:00

On my registration form I have four inputs: username password email address web address

  • 0

On my registration form I have four inputs:

username  
password
email address
web address

Can’t figure which off all available sanitizing methods is really needed:

strip_tags()
substr()
mysql_real_escape_string()
trim()
htmlentities()
addslashes()
. . . (you may add more)

Somewhere I found that a function is a must have, somewhere this function is declared as deprecated or less valuable the another one ...

Could someone be so kind to create a list of priorities for all four inputs above.

Note: PDO - prepared statements are already used for communication with database.

  • 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-17T06:37:07+00:00Added an answer on June 17, 2026 at 6:37 am

    First you need to be clear about hat for you like to sanitize.

    Because you use allready prepared statements there is no need for:
    mysql_real_escape_string()

    If you like to deny you users the use of html, to avoid XSS you should perhaps use
    strip_tags()

    To secure your html display agains not printable characters
    htmlentities()
    But in times of UTF-8 its a little obsolet.

    For password input it can be used
    trim()
    because it helps if youser copys passwords with leading / attached space.
    Because outlook add spaces. But not everybody think this is an good idea, to trim passwords.

    Depends on your Templating system it could be an good idea to use
    addslashes()
    for pre defined input values like

    <input type="text" value="<?php addslashes($value); ?>" />
    

    because it could be possible to do:

    my value " /><script>evil things</script><
    

    To have some kind of XSS in autocomplete forms.

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

Sidebar

Related Questions

I have a registration form that users fill with their email address (and password).
I have a registration form which displays a users Name (textbox), Email (textbox) and
In registration form of my web application I have a password field. Now when
I have registration form, which is saving user info in 'tblusers' -> 'Username', but
In my web application i have registration form, when user register i want to
I have a registration form leveraging xVal to handle all validation on the form.
i have a registration form which contains a postalcode and a country drop down
I have one registration form, I don't want people to register login username with
I have a user registration form that has a password and confirm password field.
I have a registration form on a website, the registration calls a function which

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.