12-16-2017, 01:05 PM
(12-15-2017, 09:03 AM)Wouter60 Wrote: You can't use a header with the name 'mobile'.
For a complete list of headers, see:
https://developer.mozilla.org/nl/docs/Web/HTTP/Headers
But why do you need a header to pass a value to a model?
You can include the code in the url, like this:
http://website/test/test_value/0910000000
Your controller (test) gets the value as a parameter for the function test_value:
PHP Code:public function test_value($mobile)
{
//Based on the url in the example, $mobile has the value '0910000000';
}
Or, you can assign a value to a session variable for later use:
PHP Code:$this->session->mobile = '0910000000';
redirect('....');
After a redirect to another page, your controller can read the value like this:
PHP Code:$mobile = $this->session->mobile;
And then, you can pass this value to your model to check the corresponding data.
I cannot pase field in url because i use header key in all model that i send it from app to api
Finally i decide to use session that you suggest me
Thanks