Welcome Guest, Not a member yet? Register   Sign In
Inserting post data
#2

[eluser]Armchair Samurai[/eluser]
RTM: empty()

You can only use variables with empty() - anything else will throw an error. If you want to do this, maybe best to loop through the post array then remove anything that has no value.

Alternately:
Code:
if ( ! empty($_POST['title'])) { $this->title  = $this->input->post('title');  }          
if ( ! empty($_POST['firstname'])) {$this->firstname = $this->input->post('firstname');  }          
if ( ! empty($_POST['middlename'])) {$this->middlename = $this->input->post('middlename');  }
...........


Messages In This Thread
Inserting post data - by El Forum - 06-06-2010, 08:27 PM
Inserting post data - by El Forum - 06-06-2010, 11:46 PM
Inserting post data - by El Forum - 06-07-2010, 12:48 AM
Inserting post data - by El Forum - 06-07-2010, 04:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB