I know this kinda seems like a stupid question and with more research i might be able to find the answer but i have a deadline to please help.
Using codeigniter im trying to see if the 'ID' in the url is 'uID' (user id) or 'sID' (system id).
the code im using is:
if(isset($this->input->get('uID'))) {
$getID = $this-input->get('uID');
} else {
$getID = $this->input->get('sID');
}
when i use that i get a server error saying website is temporarily down or under constrcution. Any ideas?
Thanks in advance for the help. Usually i would spend more time searching for the answer myself but i just dont have time tonight.
The warning you're getting is probably a 500 error -- meaning your server is not set up to display errors to you, or you don't have it enabled in your index.php file.
The error you're getting, but not seeing is: "Fatal error: Can't use function return value in write context" because you can't use isset on a function.
If you could it wouldn't do what you're expecting as CI's
$this->input->get('key')
always returns a value -- it returns false if the key does not exist.Therefore, to accomplish what it seems you're trying to do, you'd write:
Based on the comment below, I thought I'd also provide it in a way that makes sense to you:
The two solutions are functionally the same.