php - Route protection from multiple referrer - Laravel -


i'm trying protect route if not accessed particular page , have below piece of code doesn't work expected;

$referer = request::header('referer');  if ($referer != "http://www.xxx.co.uk/login" || $referer != "http://www.xxx.co.uk/signup") {     return redirect()->route('/'); } 

i'm doing wrong if statement because below works;

$referer = request::header('referer');  if ($referer != "http://www.xxx.co.uk/login") {     return redirect()->route('/'); } 

the difference being removed or part. need protected if not accessed both paths. adding else if statement breaks aswell

you have use && operator instead of ||.

in case, using ||, when single condition falsy, other truthy, statement executed.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -