I just read an article on tdwtf.com . Typically, he describes an archiver that destroys things because it ignores headers. Then I realized that I did not know how to make security on a page WITHOUT headings. So my question is:
What security measures can I use besides using headers?
I mainly develop in php, so I am familiar with the header ("Location:") function. But what else is there?
Ideally, I want to replace the logic
if (!$something_important) header("Location: somehereharmless.php");
with something else (more) safe?
header: , . - .
- :
<?php function redirect($url) { header('Location: ' . $url); exit('<a href="' . $url . '">Redirecting you to: ' . $url . '</a>'); } redirect('somepage.php'); ?>
, , .
[]
, POST . GET (, <img src="http://www.example.org/action.php?do=SetAsAdmin&userid=MyUserId" />).
POST
GET
<img src="http://www.example.org/action.php?do=SetAsAdmin&userid=MyUserId" />
if (!$something_important) { header("Location: somehereharmless.php"); exit(); }
, , , ,
,
Idempotent , , .
, PHP script, , , , , , script, , . , :
if (user_is_authorized()) { // restricted code here }
if (!user_is_authorized()) { // send headers or whatever if you want exit(); } // restricted code here
, ... , , ... - , - , HTTP. - , , . , ( , ). , () HTTP- . ( , HTTP-, ), , , , .)
, , exit; header();. , script .
exit;
header();
if (!$something_important) { header("Location: somehereharmless.php"); //close all your db connections and other stuff you need to end..parhaps calling a function? die("If the redirect doesnt start in 3 seconds, please <a href=\"somehereharmless.php\">click here</a>"); }
<?php die($errormessage);
Die script, , , .
. ( "" ), . .
if($foo && $bar) { header("Location: somehereharmless.php"); } if($foo && $baz) { header("Location: someotherplace.php"); }
, 3 , someotherplace.php. (); (); ();
Source: https://habr.com/ru/post/1706098/More articles:InheritanceBasedAopConfigurer using runtime constructor arguments - c #How to add a missing index to an array in php? - arraysЕсть ли способ использовать VS с удаленным сайтом, доступным только sftp? - c#Could not access Winforms control in class - c #Can I close the program from the main designer? - multithreadingИспользование форм HTML в ASP.NET MVC? - asp.net-mvcCompact Framework: Failed to use InputPanel in control - visual-studio-2008Does the GPL infect? - phphttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1706102/how-to-i-add-ssis-packages-to-the-msdb-database-on-sql-server-2005&usg=ALkJrhi8WoMWgfrBn0XWxiThp55PaUTnYQFacebook user does not have an avatar, but the empty avatar by default is not displayed in my web application - facebookAll Articles