Old 21-02-2007, 21:58   #1 (permalink)
pgo
i'm done, son
 
Join Date: Jan 2005
Posts: 12,262
post variables

That's strange. On my contact form, I have it shorten the post variables, i.e. "$email = $_POST['email'];" for the sake of simplicity in form processing.

However, if I remove that line, the variable $email still works - with the correct value and everything!

How does it automatically know to check $_POST['email'] when the script is testing against $email?

Any ideas?

(NOTE: Only my host does this - my local system won't do recognize it.)
  Reply With Quote
Old 22-02-2007, 04:55   #2 (permalink)
cam
vague™
 
cam's Avatar
 
Join Date: Mar 2004
Location: Glasgow
Posts: 5,293
your host must have register globals on, which it really shouldn't
__________________
Random goodness at The Blog

  Reply With Quote
Old 22-02-2007, 08:05   #3 (permalink)
d*d
Senior Member
 
d*d's Avatar
 
Join Date: Oct 2004
Location: Bristol
Posts: 3,151
bad for security that
  Reply With Quote
Old 22-02-2007, 09:27   #4 (permalink)
freelancr
Senior Member
 
freelancr's Avatar
 
Join Date: Oct 2006
Posts: 2,060
PHP4 config had register_globals on by default, it is bad for security as the end user could change your variables (using the address bar) if you didn't code it properly.

PHP5 config has register_globals off by default.

There are ways of disabling register_globals off in your php files just for your website. Google it, and test it by playing with php_info().
  Reply With Quote
Old 22-02-2007, 10:26   #5 (permalink)
pgo
i'm done, son
 
Join Date: Jan 2005
Posts: 12,262
I was afraid of that. phpinfo() confirms it. Time to have a word with the ol' host...

Apparently, I'm on one of their older servers. New ones have register_globals off by default and I'm going to request that they move me.

Last edited by pgo : 22-02-2007 at 10:38.
  Reply With Quote
Old 22-02-2007, 22:32   #6 (permalink)
pgo
i'm done, son
 
Join Date: Jan 2005
Posts: 12,262
Quote:
Originally Posted by freelancr
There are ways of disabling register_globals off in your php files just for your website. Google it, and test it by playing with php_info().
My host's support suggested that I can create a php.ini file for each domain I host that sets register_globals off. If I'm not interested in doing that, they said they'd move me to a different server (one of the newer ones with r_g disabled).
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8