Welcome! Log In Create A New Profile

Advanced

$_POST shortcut...

Posted by Mac 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar
Mac
$_POST shortcut...
May 01, 2006 09:26AM
OK, now that you understand the requirement and use of $_POST, it becomes quite clear that with bigger forms you are going to spend a lot of time typing (even if you include all your $_POST in an include file).

Try @extract($_POST); at the top of your page.

Just that - for all variables. No need to $var=$_POST['var']: for each variable.

But know this - you WILL make use the way you've been doing it up to now every now and then.

AND if you are passing arrays, you will have to do extract them like this (working with $language):

while (list ($key,$lang) = @each ($language)) {
echo "$lang,";
}
Re: $_POST shortcut...
May 03, 2006 08:22AM
I have try this and it work well. Make life a lot easier if one have a lot of variables. smiling smiley
Re: $_POST shortcut...
May 04, 2006 07:56AM
Sweet tip. Thanks smiling smiley

Murphy's Technology Law 7
-- The attention span of a computer
is only as long as its electrical cord.
Sorry, you do not have permission to post/reply in this forum.