Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GET and POST method problem, key array changes

Status
Not open for further replies.

sc7090

Technical User
Oct 28, 2003
21
0
0
IT
Hallo to everybody,
my problem is very simple: if i write:

<input name="F2070.1" type="hidden" value="12" />
<input name="name" type="hidden" value="F2070.1" />

the print_r result for $_GET and $_POST array is:

Array ( [F2070_1] => 12 [name] => F2070.1 )

So, what happend to the key F2070.1?? I use php module and Apache version is 2.0.43

Any idea? thanks in advance for your interest.

Claudio.
 
Hi

This question belongs to forum434 ( PHP ). Changing the characters other then alphanumericals and underscore to underscore comes from the old times bad habit of creating variables for each form field.

Feherke.
 
Thanks Feherke, i wasn't sure it was a php issue. But now i'm curious: what's the alternative to my old times habit?
I really appreaciate any suggestion that can help to improve my programming knowledge.
I move this thread to php forum as you suggested.

Thanks again,

Claudio.
 
Hi

No, the old bad habit is not your. You use the $_GET and $_POST arrays as encouraged by the PHP developers. ( The problem would be if you used $F2070_1 instead on $_GET[F2070_1]. See also the article about register_globals. )

How to solve the problem and get the original names in the keys ? No idea. At least not a good one. I needed this only once, then I get the $_SERVER[QUERY_STRING] and [tt]split()[/tt]-ed it to get a correct replacement for $_GET.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top