When I use $_SERVER['HTTP_ORIGIN'].
echo $_SERVER['HTTP_ORIGIN'] ;
Return Notice: Undefined index: HTTP_ORIGIN in D:\xampp\htdocs\safe\test.php on line 12
What is Wrong?!
When I use $_SERVER['HTTP_ORIGIN'].
echo $_SERVER['HTTP_ORIGIN'] ;
Return Notice: Undefined index: HTTP_ORIGIN in D:\xampp\htdocs\safe\test.php on line 12
What is Wrong?!
The HTTP_ORIGIN is neither sent by all browsers nor it is secure to trust. You should really use:
echo $_SERVER['HTTP_REFERER'];
The issue happens to you because that particular browser hasn't set the origin. You don't trust HTTP_REFERER as well. It is as insecure as the former.