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

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -