When I try to submit a form to my site, I get the following error:
Fatal error: cannot access empty property in function / form _validation.php on line 15
Code to verify the form:
class Validation { var $success; var $post_data; var $errors; var $delimiter; function Validation($HTTP_POST_DATA) { $this->success = true; $this->errors = false; $this->$post_data = $HTTP_POST_DATA; $this->delimiter = "|"; while(list ($key, $val) = each ($this->$post_data)) { $this->{$key} = $val; } reset($this->$post_data); while(list ($key, $val) = each ($this->$post_data)) { if(method_exists($this, $key)) { $cmd = "\$this->".$key."();"; eval($cmd); } } }
Code from the form page:
include_once($APP_ROOT . "functions/index.php"); include_once($APP_ROOT . "functions/form_validation.php"); $CONTINUE = TRUE; $valid = new Validation($_POST); if($CONTINUE = $valid->success) {
This code worked very well before we switched to PHP5. Any idea what I need to change to get it working again?
thanks
source share