Re: [PHP4BETA] php 4 and OOH forms?
| From: | Andres Sa\"de | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: [PHP4BETA] php 4 and OOH forms? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3011@lists.php.net to get a copy of this message | ||
On Fri, 30 Jul 1999, Eric Mings wrote:
> I recently posted about a problem I am having using pages containing OOH
> forms in php 4. These same pages worked fine in php 3.0.9. Thus far I
> haven't found the source of the problem. If anyone has OOH forms working
> in php 4 please let me know if you had to make any changes to get it to
> work. Again the error I have been getting is:
>
> Fatal error: Call to a member function on a non-object in oohforms.inc on
> line 192
>
> Which reflects part of the code in oohforms.inc below:
>
> 186 function show_element($name,$value="") {
> 187 if (!isset($this->elements[$name]["which"]))
> 188 $this->elements[$name]["which"] = 0;
> 189 $el = $this->elements[$name]["ob"];
> 190 if ($this->elements[$name]["frozen"])
> 191 $x =
> $el->self_show_frozen($value,$this->elements[$name]["which"]++);
> 192 else
> 193 $x = $el->self_show($value,$this->elements[$name]["which"]++);
> 194 $this->elements[$name]["ndx_array"][] = $this->n;
> 195 $this->n += $x;
> 196 }
>
> If anyone has suggestions I would greatly appreciate it. Thanks.
Try replace $el with $eli(or something else) in begining on function
add_element. When u don't replace it, the statment $el = new $t($el)
puts the new object $el to $t($el) but the second $el must be array as u
know.
function add_element($eli) {
^^^^ replace here
if (is_array($eli)) {
^^^^^ and here
$cv_tab = array("select multiple"=>"select",
"image"=>"submit");
if ($t = $cv_tab[$eli["type"]]) $t = ("of_" . $t);
^^^^^ and here
else $t = ("of_" . $eli["type"]);
^^^^ and here
$el = new $t($eli);
^^^^^ and here
.
.
.
*********************************
Andres Sa"de
AS Stallion
email: andres@stallion.ee
Tel: 656 7726
GSM: 255 23 050
**********************************