Welcome Guest, Not a member yet? Register   Sign In
Add key to header in all page
#9

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.
Reply


Messages In This Thread
Add key to header in all page - by omid_student - 12-14-2017, 04:58 AM
RE: Add key to header in all page - by Wouter60 - 12-14-2017, 11:26 AM
RE: Add key to header in all page - by Wouter60 - 12-14-2017, 02:03 PM
RE: Add key to header in all page - by Wouter60 - 12-14-2017, 10:58 PM
RE: Add key to header in all page - by Wouter60 - 12-15-2017, 09:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB