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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:15:12+00:00 2026-05-16T22:15:12+00:00

I have built simple PHP application by looking at various articles and tutorials around

  • 0

I have built simple PHP application by looking at various articles and tutorials around the web. Since I am now giving it to a few clients, I am worried about its security. How do I make sure it doesn’t get hacked?

  • 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-16T22:15:13+00:00Added an answer on May 16, 2026 at 10:15 pm

    If you’re talking just from the perspective of making your code secure, there are some things you should be aware of (this is an incomplete list but should get you started):

    SQL Injection

    If you have any SQL queries in your application and any of them use input from the user, you could be vulnerable to SQL Injection. This is when the user submits something malicious in the place of a form field, which, when inserted into your query, will give the attacker the ability to access other parts of your database.

    How to prevent: any input you get from the user needs to be sanitized before you use it in a query. In order to do so, you can use prepared (or parameterized) statements (ie. mysqli::prepare or PDO) or use a function that properly escapes your input values before you use them in your queries (ie. mysql_real_escape_string)

    Cross-site scripting (XSS) attacks

    If you take any input from the user and output it in another page (for instance, you might collect user data and then output a list of users), you could be vulnerable to an XSS attack. The way these work is by adding code (generally <script> tags) into form fields, and if they are not sanitized before being output, the attacker will have added their own Javascript into your page, which will run in the context of your page (and therefore, have access to things like your cookies).

    How to prevent: Unless there is a good reason to be letting your users output HTML, every time you output something that comes from the user, it should be sanitized with htmlspecialchars, which will turn potentially dangerous characters (< and > for instance) into HTML entities. If you must let your user output HTML, you should have a specific set of tags that are allowed and ensure that only those tags are allowed through (using a DOM parser or strip_tags for example).

    See also: The Cross-Site Scripting (XSS) FAQ

    Cross-site request forgery (CSRF) attacks

    This is an attack where an attacker tricks a user’s browser into making a request on its own (for instance, by injecting code into your site, though the attack can actually originate from anywhere) that takes advantage of authentication cookies stored in the user’s browser. For example, let’s say you had created a banking application, an attacker could cause a legitimate user who still has an active authentication cookie for your site to request http://yourapp.com/transfer_funds.php?to=attacker, without knowing it.

    How to prevent: GET requests should be idempotent (that is, should always have the same effect, or should not cause your application state to change). That means that any operations that the user can do (for example, CRUD operations) should be made through POST, not GET. Similarly, you should check $_POST, and not $_REQUEST for these operations, because $_REQUEST will contain values from both $_POST and $_GET.
    However, your application can still be vulnerable to CSRF even if you’re using POST. In order to protect better, many people use a system of challenge tokens, where the application generates a random string that is related to the user session. This challenge token is passed along with any relevant requests the application itself makes (by including it in the form) and then is verified before any operation is allowed to take place. Note that if your application has an XSS vulnerability, your challenge token can be compromised.

    See also: The Cross-Site Request Forgery (CSRF/XSRF) FAQ

    Exploiting eval or system commands

    If you use eval along with user input, you are opening up your entire application environment (and beyond that, your server environment) to a potential attack, because if you aren’t extremely careful (and even if you are), you are giving users the ability to run whatever arbitrary code they want. This could result in anything from modifying your database, changing your server environment, installing and running scripts or binaries on the server, deleting your PHP files… (this same sort of attack applies to any PHP function that makes a system call, including system, fopen, any of the functions that access the filesystem…so be very careful when you use user input!)

    How to prevent: Do not use eval with user input. If you think you need to use eval with user input, there probably is a better (and safer) way to solve the problem.

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

Sidebar

Related Questions

I have a cakePhp application built, and now I'm creating a simple blog based
I have built a small web application in PHP where users must first log
Hi I have built a simple WCF application I am using to query data
I have built a very simple blog application using Ruby on Rails. New to
I have a simple Android application that uses a JAR I have built. When
I have a simple web app built in asp.net webforms c# where and how
I am using codeigniter php MVC framework to develop a web application. I have
I have a web application, written in PHP that incorporates Javascript and JQuery, that
I have a web application, written in PHP, based on UTF-8 (both PHP and
I recently inherited a simple PHP application built on Piwi ( http://www.piwiframework.de/default.html ). Has

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.