Welcome Guest, Not a member yet? Register   Sign In
Hash symbol in URL causes a problem
#5

(03-25-2015, 03:21 AM)Goldie Wrote:
Code:
$id = $this->uri->segment(2);

...assuming that $this->uri->segment(2) is nothing but number, like I remapped it in routes.php

Never assume anything coming from user input. You should type-cast to integer to be safe and minimize risk of SQL injection:

PHP Code:
$id = (int)$this->uri->segment(2); 
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
Hash symbol in URL causes a problem - by Goldie - 03-24-2015, 06:42 AM
RE: Hash symbol in URL causes a problem - by includebeer - 03-28-2015, 04:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB