|
| |||||||
![]() | Welcome to iWEBTOOL Talk, where you talk about
webmaster-related stuff.
1 Register
2 Browse the board
3 Discuss whatever may interest you! | |||||||||||||
![]() |
| | Thread Tools | Search this Thread | Display Modes |
| | #1 |
| Retired Member Join Date: Dec 2005
Posts: 139
![]() | Hi all, I'm a "little" upset at PolurNet for turning OFF register_globals on my server without notice the other day. I wandered onto one of my sites and noticed that it just kinda... broke... for no reason and no alteration. Turns out they turned off register_globals, which is a PHP setting that defines how variables are interpreted. For example, $id is a very generic variable. But, if $id came from the URL as a GET variable (file.php?id=1) or from a form as a POST variable, it cannot be known to exist if register_globals is off. Want to see what I'm talking about? Go to www.ilookup.info and do a search. I haven't touched that site in months. What comes up? It's BLANK. There's 0 results, because it doesn't know the variables exist. My problem then: Do I have to go through the thousands and thousands of lines of code in my network of websites' code and replace $id with $_GET['id'] or $_POST['id']? That will take me WEEKS if not MONTHS to figure out and re-interpret. Is there any easier solution? -Matt
__________________ Retired Moderator/Member/Friend/Helper - it was great working with all of you! |
| |
|
| |||||||
| | #2 |
| Contributor Join Date: Jun 2006 Location: Denver
Posts: 4,459
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Yeah, contact your hosting company and request that they reset the globals. I wonder why they would turn them off in the first place? Maybe they were hacked? |
| |
| | #3 |
| Member Join Date: Dec 2005
Posts: 132
![]() | most probably they have set it off because of XSS vulnerabilities or maybe b'coz it's the worst programming practices ever known to me. unfortunately, register_globals cannot be changed using ini_set() function. If you have apache serve, you can try putting this .htaccess file in your script to turn it on: php_flag register_globals off just save it as '.htaccess' in the folder where your files are located. Just might help. OR at the top of the script type this: Code:
for each variable. Know that's pretty tedious.. but u got no real choice ![]() And from the next time, use $_GET[] and $_POST[]
__________________ Eat healthy, Stay Fit, Die Anyway. --==-- If there is a man who knows everything about women, there is a Windows distribution without bugs. |
| |
| | #4 | ||
| Retired Member Join Date: Dec 2005
Posts: 139
![]() | Quote:
Quote:
I actually just found a way to emulate register_globals... which I'll do, but from now on, I'll use $_GET and $_POST.
__________________ Retired Moderator/Member/Friend/Helper - it was great working with all of you! | ||
| |
| | #5 |
| Registered Member Join Date: Dec 2005
Posts: 1,543
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | You should be using $_GET and $_POST from the start to get your habbits going. Alternatively, you can add that line (rohan2kool posted) to your .htaccess and it should be working
__________________ Wanna thank someone? Give 'em a rep. More info. Last edited 07-30-2006 at 04:09 PM. |
| |
(Threads which have no activity for more than 30 days are automatically closed.) |
| Quick Reply | ||
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need advice about buying | Spirit | Domain Name | 17 | 10-10-2006 06:12 AM |
| Advice and Review PLEASE ! | mrveryrich | Website Reviews | 2 | 08-28-2006 07:24 PM |
| Need some advice | autosurfnetwork | Marketing and Promotion | 3 | 05-08-2006 09:03 PM |
| need seo advice | jenifer | Search Engine Optimization (SEO) | 2 | 04-21-2006 11:38 AM |
| Can Sum1 Plz Advice | sadiqbaig | Search Engine Optimization (SEO) | 4 | 01-09-2006 07:34 AM |