Forum Moderators: coopster

Message Too Old, No Replies

period becomes underscore in submitted form control name

PHP doesn't seem to like the period

         

penders

4:44 pm on Oct 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



My HTML form contains:
<input type="submit" name="useredit_my.test" value="Edit" />

But when submitted, PHP gets this:

Array 
(
[useredit_my_test] => Edit
)

Where did my period go?

(Actually, thinking about it, this is similar to what happens when a type="image" submit button is clicked. Ho hum...)

dreamcatcher

5:39 pm on Oct 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP variables cannot contain period symbols. Looks like its defaulted to an underscore.

dc

penders

7:50 pm on Oct 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ah yeah, I guess if register_globals was on then it would try and create a variable of that name! But with it off, it's just a key in an associative array - where it would be OK to have a period. Ah well, I'll do it different next time! Thanks.