Go Back   Webmaster Forums UK SEO SEM Webmaster Community Forum - UKWW > General > General Webmaster Talk
Register FAQ Members List Downloads Calendar Today's Posts Webmaster Resources Webmaster Blogs
 
 

General Webmaster Talk General webmaster discussion forums - In this forum and its sub forums you can discuss general webmaster related issues or even issues that does not related to Webmastering.
Sub Forums: Running a forum :: Blogs and Blogging :: Word Press Forums :: Digital Photography

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-24-2005, 01:06 PM
ovi
Guest
 
Posts: n/a
Default Turning off register_globals

As I have been learning the ins and outs of PHP, I have come across some cool tricks that you can do when you are running PHP on Apache (as most of you are, I bet). In a hosted environment, one does not usually have access to the PHP.ini file. Oftentimes the default settings are not appropriate for what you are doing, so we need a way to change those settings for your application. Here is where Apache steps in.

Using the .htaccess file, you can set values for the PHP engine to use at runtime. It is really quite simple to do. The following is the format:

Code:
# in Apache files, pound-signs ("#") comment out a line...

# to set a boolean value
php_flag setting_name on|off

# to set any other values
php_value setting_name setting_value
The most common thing that I set is the register_globals flag. When register_globals is on, all variables from the query string (GET), all variables from forms (POST), and (I'm pretty sure) all variables from cookies are automatically available as local variables. That is, if you have a query string like "index.php?fuseaction=home.main&foo=bar&stan=c ox", in the PHP page, you can access them as $fuseaction ("home.main"), $foo ("bar"), and $stan ("cox"), if register_globals is turned on. That may be just fine for your purposes, and it certainly can make your coding easier.

However, I think it is a little sketchy to allow users to directly affect variables in your script, so I ALWAYS turn it off. Like so:

Code:
php_flag register_globals off
Ovi
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 06-28-2005, 06:23 AM
Duke
Guest
 
Posts: n/a
Default

I'm just curious but doesn't disabling this feature make it impossible to link to a certain topic within a forum because the url's are now all the same or am I just misunderstanding the message?
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Webmaster Resources
 
The Forum Rules
Forum Rules - MUST READ
 
Site Of the Month
BizzFace
Nominate site of the month
 
Tag Cloud
affiliates article service article writer article writing b2b directory blogging money blogs business directory categories menu content writer content writing services directories directory directory script e4 media group e4mediagroup.com ecommerce forum free submit godaddy godaddy codes godaddy coupon godaddy promo home user iphone 3gs justdial clone link pages menu paid directories right sidebar search engine script sell link submit site free website yellow

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Brits turning into computer buffs temi General Webmaster Talk 0 09-25-2004 01:19 AM
UK turning into nation of gamers temi Computer and Video Games 0 09-22-2004 06:12 AM


All times are GMT. The time now is 11:26 PM.

UK Webmaster World Forums - Internet marketing, web development, domain names, SEO contest and discussuons.
Subscribe to our feeds   Subscribe to our feeds

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0