Register Globals Emulator for PHP
If your webhosting turned register-globals off and you are still using a script/software which requires register-globals on you have a problem. But there is an easy solution: Just put this code at the top of your php script(s). Attention!!! "register_globals=on" means a huge security risk. Do not turn it on unless you know what are you doing!
Technorati Profile
foreach(array($_GET, $_POST, $_COOKIE) as $k=>$v){
foreach($v as $k2=>$v2){
$$k2 = $v2;
}
}
You can improve this to build a small web-firewall and prevent sql-injection etc. You can add some code and strip unwanted html-javascript tags with this.
Similar entries
- How to filter all html tags from each _GET and _POST request
- How do I secure my web site?
- Common HTML / Web colors
- Web Application Security Papers
- Redirect webpages with HTML, PHP, .htaccess, Java+Script, CGI-Perl, ASP.NET and ColdFusion
- Do I need Iptables, Lokkit Firewall and APF same time?
- Web2 style secure & flexible free php contact form with easy setup
- Affiliates
- Url manipulation with mod_rewrite and php-catcher for beginners
- Random tip / info-box with javascript array
- Let your visitors run Drupal cron for you
- Fix Google Adsense Search and Drupal Conflict
- Can I convert avi, mpeg videos to swf flash using PHP?
- A small login to add to top of online testing scripts
- Redirect a query to multiple search engines with one form and javascript
- Sleep Function for JavaScript like PHP
- Pure CSS Mouseover Menu without Javascript
- WebSearch
- DropDown / Rollover Menu with pure CSS / HTML
- Hide your email address + mailto link with javascript from spammer

Comments
or just use:
extract($_REQUEST);
Opinion
The best books search in electronic libraries. Searches in a huge amount of libraries, many new submitions every day.
Having register_globals = on
Having register_globals = on does not mean a huge security risk. Also, the provided code does not emulate it properly so instead consider using an example from the manual:
http://php.net/manual/en/faq.misc.php#faq.misc.registerglobals
just use extract($_REQUEST);
just use extract($_REQUEST);
Post new comment