Need a little help...
How do I include a variable in a form? Like this:
$FORM{'$variable'}
So that the name of the input is a variable.
Thanks!
--Edge
How do I include a variable in a form? Like this:
$FORM{'$variable'}
So that the name of the input is a variable.
Thanks!
--Edge
japhy posted this at 05:43 — 7th December 2000.
They have: 161 posts
Joined: Dec 1999
Perhaps you should leave off the single quotes.
$FORM{$variable};
If you're asking how to "come up" with the %FORM hash, I'd stay away from that, and use the standard CGI.pm module:
use CGI 'param';
# ...
print param($variable);
Edge posted this at 01:42 — 8th December 2000.
They have: 117 posts
Joined: Mar 2000
Nevermind, I found out how to do it. If anyone wants to know, here's how:
$FORM{\"$variable\"}
Thanks for trying anyway, japhy!
--Edge
japhy posted this at 02:17 — 8th December 2000.
They have: 161 posts
Joined: Dec 1999
The quotes around that variable name are TOTALLY unnecessary, and will only cause you trouble later, eventually.
$hash{$key}
is PERFECTLY fine, and is preferred over
$hash{"$key"}
Make a note of this!
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.