• Sitemap
  • Copyright Policy
  • Privacy Policy
  • About Me
bloggingaster logo
  • How To
  • Blogging
  • Coupon Codes
  • Softwares
  • WordPress
  • SEO
  • Android
  • Facebook
  • Programming
  • Tech News

How To Check PHP Code In Uploaded File / Text Area – PHP Security

By Yogendra Sharma on February 8, 2013
This is very important security check to find PHP code/script in an uploaded file or text entered in Text Area/Box to prevent its execution. Sometimes, hackers or spammers attacks to the database through the commonly used contact form or registration form having the option of file upload or text via text area. To ensure the security, we should check whether the uploaded file or text coming from text area contains some PHP script/code. It may harm your database once it’s inserted into the database.PHP Tutorials
Some developers uses a check to find “<?php” but it is not practical, also it may create ambiguity. Be practical, whether the file contains harmful php code it doesn’t do anything if we prevents it’s execution or store these php files at the place where they can’t be executed by PHP Interpreter.
1.Keep all such files at the same place (directory) and put a .htaccess file in its root with the following code-
php_flag engine off

This will also helps to prevent the execution of php scripts embedding within the .gif files.
2. You can also ask the Apache handler through the handler command. This will force all the files present in a specific directory to be processed  by a certain handler given by you-

<Location /web/uploads/files>
SetHandler None
</Location>

I hope the above ways of security check of php code was helpful and works well in your next development project. Let me know if still you’ve any doubt regarding the same and share your knowledge or experience below in comment to help others.

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading ... Loading ...
Posted in How To, Programming, Security | Tagged PHP, PHP Basics, PHP Security
Cancel Reply
Previous Entry: Free File Hosting HTML, JS & CSS Files On Google Drive
Next Entry: ‘The Internship’ Official Trailer – Google’s Upcoming Movie
  • Facebook
  • Google+
  • Linkedin
  • Pinterest
  • RSS
  • StumbleUpon
  • Twitter

What You’re Looking For?

Blogging & Social Media On Google+
Follow @BloggingAster
  • Technorati
  • RSS

Recent Posts

  • How To Remove / Hide Embed YouTube Video Title | YouTube Tricks
  • Google RSS Feed Reader Shutting Down
    RIP: Most Popular Google RSS Reader Shutting Soon | Google Confirmed
  • Hostgator Web Hosting
    Hostgator Coupon Code 2013 | Hostgator Hosting 35% Discount Coupon
  • Godaddy Domain Registrar Hosting Provider
    Domain Transfer & Register .COM 1.49$ Godaddy Coupon Code 2013
  • Godaddy domain & hosting provider
    Godaddy 1$ Domain Coupon Code 2013 – Register .COM & Domain Transfer
  • The Internship - Google Upcoming Movie
    ‘The Internship’ Official Trailer – Google’s Upcoming Movie

Popular Posts

  • Free download Opera Mini 7.0 Mobile Browser for Android (.apk file)Free download Opera Mini 7.0 Mobile Browser for Android (.apk file)
  • YouTube Downloader for Chrome – Download YouTube Videos FreeYouTube Downloader for Chrome – Download YouTube Videos Free
  • Adobe Photoshop CS6 Beta Latest Version Free Download – Check New FeaturesAdobe Photoshop CS6 Beta Latest Version Free Download – Check New Features
  • Godaddy 1$ Domain Coupon Code 2013 – Register .COM & Domain TransferGodaddy 1$ Domain Coupon Code 2013 – Register .COM & Domain Transfer
  • Google Chrome 24.0.1 Dev latest Version Full Download – Offline InstallerGoogle Chrome 24.0.1 Dev latest Version Full Download – Offline Installer
  • Godaddy 1$ (0.99$) .COM Domain Coupon Code 2013 – Bulk Domains TransfersGodaddy 1$ (0.99$) .COM Domain Coupon Code 2013 – Bulk Domains Transfers
  • Advantages & Disadvantages of C Language: C Programming FeaturesAdvantages & Disadvantages of C Language: C Programming Features

Contact Me

  • Yogendra Sharma
  • Web Developer/Freelancer
    • Gautam Buddha Nagar, Greater Noida Uttar Pradesh 201310 India
  • yogendrasharma@outlook.com
  • Download vCard
Protected by Copyscape Website Copyright Protection
    • Like us on FacebookLike us on Facebook
    • Follow us on TwitterFollow us on Twitter
    • Follow us on Google+Follow us on Google+
    • Follow us on PinterestFollow us on Pinterest
    • Subscribe via RSSSubscribe via RSS
  • Online Marketing


Copyright © 2013 BloggingAster.com | Privacy Policy | Sitemap