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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:30:54+00:00 2026-05-31T01:30:54+00:00

I’ve read up on SQL Injection, XSS and other security issues and am trying

  • 0

I’ve read up on SQL Injection, XSS and other security issues and am trying to figure out what to use to safeguard the company’s site.

We are about to deploy a simple ‘User feedback’ form with a textarea so users can tell us how to improve the site to enhance their user experience.

When the user pushes ‘submit’ on the form, we read the textarea comments from the user, and then programmatically create a filename in that user’s subfolder and save their comments to a file. Then we add the filename and path to that user’s database record.

The team is not worried about security issues here but I am. Their thinking is “we create the filename, it is 0% based on any user input, and since we write this ‘UserX comments’ filename and path to the database with no direct user influence — there is no risk.”

My concern is NOT the database activity — because they’re right, the user has no role in WHAT we write to their database record since we’re just creating our own filename and storing it in their db record.

My concern is the text file!

So I’m petitioning our small team to rewrite the code to use security to read then write the user’s comments in the textarea to the text file.

My concern is — since we plan to actually READ our user’s feedback and open these text files to read them later on — there might be bad stuff in the textarea that (unless we clean it) could hurt us somehow.

I’m insisting we use strip_tags() but I need to sound informed about the manner in which we sanitize the textarea input — I’m thinking strip_tags() is the way to go here but I’m 100% new to sanitizing user input. I looked at htmlspecialchars() but that just converts certain characters like ‘&’ to &
and so forth.

Are there other ways to santize/make safe any text the user types into a textarea before we write it out to a file on our web server?

  • 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-31T01:30:55+00:00Added an answer on May 31, 2026 at 1:30 am

    Looks like strip_tags is a good way to go. I’d also suggest writing the file outside of the webroot so that it can’t be accessed by a browser.
    See also: This Other Thread

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.