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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:34:57+00:00 2026-06-01T14:34:57+00:00

I am about to launch my website and security is important so i wanted

  • 0

I am about to launch my website and security is important so i wanted to outline what I have done to secure the site. Please correct me if I am wrong and if I need something else:

  • To connect to our server, I have a two-factor authenitcation enabled via VPN.
  • The site uses SSL
  • Data is encrypted at rest.
  • I have a log monitoring tool
  • WHen users enter data into the database i use mysql_real_escape_string(); and when i display user data i use htmlspecialchars();
  • Passwords are stored using md5 encryption.

         Sample insert query: 
    
         // I use these on every page
         $username = removeBadChars($_SESSION["username"]);
         $password = removeBadChars($_SESSION["password"]);
    
         //Sanitized data
         $_SESSION["username"] = $username;
         $_SESSION["password"] = $password;
    
         //Query to display 
         $sql = "select `User_name`, `User_id`, `User_kind` from `clientele` 
         where `username` =   '$username' AND `password`='$password'";
         $query = mysql_query($sql) or die ("Error: ".mysql_error());
    
          while ($row = mysql_fetch_array($query)){
    
      $name = htmlspecialchars($row['User_name']);
      $uid = htmlspecialchars($row['User_id']);
      $uis = htmlspecialchars($row['User_kind']);
    
          }
          mysql_free_result($query);
    
    
    
          //Insert Query
    
          $title = mysql_real_escape_string($_POST['title']);
          $comment = mysql_real_escape_string($_POST['comment']);
    
          $insert = "INSERT INTO table (Title, Comment)
          VALUES ('".$title."', '".$comment."')";
    
           $query = mysql_query($insert) or die ("Error: ".mysql_error());
    
  • 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-01T14:34:58+00:00Added an answer on June 1, 2026 at 2:34 pm
    1. Use a stronger hash function (e.g. sha256)
    2. Append a salt (random value for every user) to the password before hashing it
    3. Use prepared statements (MySQLi) instead, to avoid the possibility of forgetting to escape data before entering it into the database
    4. Do not store user information in $_SESSION. Instead, store a session variable that means nothing to the outside world, changes every time someone logs in, and links to the user account. – This only applies to cookies. drinks some caffeine
    5. Be careful putting data from user in attribute values (e.g. <span title="FULLNAME">), as additional escaping is needed (quotes, spaces if not using quotes, etc)

    Note: This list is not exhaustive. It only lists things I noticed that were wrong with the short snippets you provided.

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

Sidebar

Related Questions

I'm about ready to launch our company's web site on Amazon's EC2, and have
We're about to launch a public facing site, and the security review team has
I have a site that is about to launch and a request for URL
Just about to launch a WordPress site but have noticed that it's currently loading
I'm about to re-launch a corporate website which has the same link structure for
I'm about to launch an ASP.NET web site which will be running on a
We have a web server that we're about to launch a number of applications
I am just about to launch a fairly large website for the first time.
I'm about to launch a site that was working well until I found the
I'm about to launch a new site and want to show my facebook page

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.