Welcome Guest, Not a member yet? Register   Sign In
Different way to work with Post Data
#1

[eluser]donkey_[/eluser]
Hi folks,

I was asking myself if this would be possible

Code:
<?php

$this->load->library('input');

$postData = $this->input->post(array('test'=>$postdata['test']));


?>

Because in the CI description you say I can work with every types such as array etc
#2

[eluser]mattpointblank[/eluser]
You don't need to load the input library, it's autoloaded.

I don't think that will work anyway - I don't think you can directly set post values (correct me if I'm wrong, CI experts).

Finally - why not just try your code and see if it works?!
#3

[eluser]Colin Williams[/eluser]
The documentation is extremely clear on how you work with posted arrays. I'm not even sure what you are trying to achieve with your code snippet.

The docs also say you don't need to load the Input class. I'm questioning whether you have read them closely enough.
#4

[eluser]Colin Williams[/eluser]
Quote: I don’t think you can directly set post values (correct me if I’m wrong, CI experts)

You can. Like this:

Code:
$_POST['custom'] = 'value';

No need to over-think this stuff.




Theme © iAndrew 2016 - Forum software by © MyBB