I have been trying to use oohforms with register globals off. I
have tried the patch available from http://www.sanisoft.com/
phplib/oohforms_patch.zip and also the latest snapshot
(0.74.20021126) available from http://phplib.sourceforge.net/
snapshots/ but still have a problem.
I have a form that loads values from MySQL into variables with
the same name as the form objects. Older versions of phplib
would load these values as the defaults with the load_default()
function. I don't get this behavior with the versions of phplib that
claim to work with register global off. Even if I turn register
globals on the old behavior does not return.
I don't claim to fully understand the oohforms code but I have
found that the following code seems to work.
function marshal_dispatch($m,$func) {
if (count($HTTP_POST_VARS) == 0) {
//No post vars...this old oohforms code loads defaults correctly
$vname = $this->name;
global $$vname;
return $this->$func($$vname);
} else {
//Post vars present...this is the latest oohforms code
global $HTTP_POST_VARS;
$vname = $this->name;
return $this->$func($HTTP_POST_VARS["$vname"]);
}
}
My concern is that this probably isn't the best way to correct the
problem and would appreciate any better alternatives.
Thanks in advance!
Logged In: YES
user_id=1003414
I am having the same problem (and posted it in another sf
forum). prepopulating a form with data has broken after a php
upgrade - even with register_globals set to on.
i apparently don't understand how oohforms is using the
namespace, or the implementation is flawed...HEEELLP!
looking at the date of the original message in this thread,
maybe the bigger question is: is anybody working on, or
supporting this project anymore?
any answer from anybody who knows anything about what's
up with phplib would be realllly appreciated.