Welcome Guest, Not a member yet? Register   Sign In
unsetting $this->input->post() value
#1

[eluser]veledrom[/eluser]
Hi,

I wish to accomplish this but no luck: unset($this->input->post('text_password'));

Is there any other way?

Thanks
#2

[eluser]Matalina[/eluser]
Try this:
Code:
$posts = $this->input->post();
unset($posts['text_password']);

You are trying to unset on a method.
#3

[eluser]CroNiX[/eluser]
@Matalina That would only unset it in the new variable, $posts.

The only way to actually wipe out a post variable is on the actual global $_POST array, which is where CI gets the value from if you use input::post().

Code:
unset($_POST['text_password']);
#4

[eluser]Matalina[/eluser]
I made an assumption that the OP was using all the post information elsewhere. My bad in assuming.

Either way he was unseeting a method and unset only works on variables.
#5

[eluser]veledrom[/eluser]
Code:
$posts = $this->input->post();
unset($posts['text_password']);

That will do because I'll be passing $posts to a session so no need to worry about what I have left in $this->input->post()

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB