I know you can send a header that tells the browser this page is forbidden like:
header('HTTP/1.0 403 Forbidden');
But how can I also display the custom error page that has been created on the server for this type of error?
By default, just sending the header displays a white page, but I remember a while back reading that you can use the customer error page. Does anybody know?
![]()
alex
472k198 gold badges871 silver badges978 bronze badges
asked Feb 21, 2011 at 2:16
![]()
0
Just echo your content after sending the header.
header('HTTP/1.0 403 Forbidden');
echo 'You are forbidden!';

answered Feb 21, 2011 at 2:21
![]()
alexalex
472k198 gold badges871 silver badges978 bronze badges
3
http_response_code was introduced in PHP 5.4 and made the things a lot easier!
http_response_code(403);
die('Forbidden');
answered Apr 25, 2017 at 14:44
Marcio MazzucatoMarcio Mazzucato
8,6037 gold badges64 silver badges78 bronze badges
Include the custom error page after changing the header.
showdev
27.9k36 gold badges53 silver badges72 bronze badges
answered Feb 21, 2011 at 2:30
![]()
3
For this you must first say for the browser that the user receive an error 403. For this you can use this code:
header("HTTP/1.1 403 Forbidden" );
Then, the script send «error, error, error, error, error…….», so you must stop it. You can use
exit;
With this two lines the server send an error and stop the script.
Don’t forget : that emulate the error, but you must set it in a .htaccess file, with
ErrorDocument 403 /error403.php
![]()
answered Apr 18, 2013 at 17:26
PyrrhaPyrrha
2112 silver badges2 bronze badges
0
Seen a lot of the answers, but the correct one is to provide the full options for the header function call as per the php manual
void header ( string $string [, bool $replace = true [, int $http_response_code ]] )
If you invoke with
header('HTTP/1.0 403 Forbidden', true, 403);
the normal behavior of HTTP 403 as configured with Apache or any other server would follow.
answered Dec 11, 2016 at 4:24
I have read all the answers here and none of them was complete answer for my situation (which is exactly the same in this question) so here is how I gathered some parts of the suggested answers and come up with the exact solution:
- Land on your server’s real 403 page. (Go to a forbidden URL on your server, or go to any 403 page you like)
- Right-click and select ‘view source’. Select all the source and save it to file on your domain like: http://domain.com/403.html
- now go to your real forbidden page (or a forbidden situation in some part of your php) example: http://domain.com/members/this_is_forbidden.php
-
echo this code below before any HTML output or header! (even a whitespace will cause PHP to send HTML/TEXT HTTP Header and it won’t work)
The code below should be your first line!<?php header('HTTP/1.0 403 Forbidden'); $contents = file_get_contents('/home/your_account/public_html/domain.com/403.html', TRUE); exit($contents);
Now you have the exact solution. I checked and verified with CPANEL Latest Visitors and it is registered as exact 403 event.
answered Oct 6, 2015 at 18:00
TarikTarik
4,11237 silver badges33 bronze badges
4
.htaccess
ErrorDocument 403 /403.html
answered Feb 21, 2011 at 2:31
6
To minimize the duty of the server make it simple:
.htaccess
ErrorDocument 403 "Forbidden"
PHP
header('HTTP/1.0 403 Forbidden');
die(); // or your message: die('Forbidden');
![]()
answered Feb 5, 2014 at 21:34
Use ModRewrite:
RewriteRule ^403.html$ - [F]
Just make sure you create a blank document called «403.html» in your www root or you’ll get a 404 error instead of 403.
answered Feb 1, 2015 at 22:46
Jay SudoJay Sudo
991 silver badge2 bronze badges
2
I understand you have a scenario with ErrorDocument already defined within your apache conf or .htaccess and want to make those pages appear when manually sending a 4xx status code via php.
Unfortunately this is not possible with common methods because php sends header directly to user’s browser (not to Apache web server) whereas ErrorDocument is a display handler for http status generated from Apache.
answered Nov 27, 2014 at 15:22
Refresh the page after sending the 403:
<?php
header('HTTP/1.0 403 Forbidden');
?>
<html><head>
<meta http-equiv="refresh" content="0;URL=http://my.error.page">
</head><body></body></html>
answered Oct 12, 2014 at 6:08
1
(PHP 5 >= 5.4.0, PHP 7, PHP 8)
http_response_code — Получает или устанавливает код ответа HTTP
Описание
http_response_code(int $response_code = 0): int|bool
Список параметров
-
response_code -
Код ответа устанавливается с помощью опционального параметра
response_code.
Возвращаемые значения
Если response_code задан, то будет возвращён предыдущий код
статуса. Если response_code не задан, то будет возвращён
текущий код статуса. Оба этих значения будут по умолчанию иметь код состояния 200,
если они используются в окружении веб-сервера.
Если response_code не задан и используется не в окружении
веб-сервера (например, в CLI), то будет возвращено false. Если
response_code задан и используется не в окружении
веб-сервера, то будет возвращено true (но только если не был установлен предыдущий
код статуса).
Примеры
Пример #1 Использование http_response_code() в окружении веб-сервера
<?php// Берём текущий код и устанавливаем новый
var_dump(http_response_code(404));// Берём новый код
var_dump(http_response_code());
?>
Результат выполнения данного примера:
Пример #2 Использование http_response_code() в CLI
<?php// Берём текущий код по умолчанию
var_dump(http_response_code());// Устанавливаем код
var_dump(http_response_code(201));// Берём новый код
var_dump(http_response_code());
?>
Результат выполнения данного примера:
bool(false) bool(true) int(201)
Смотрите также
- header() — Отправка HTTP-заголовка
- headers_list() — Возвращает список переданных заголовков (или готовых к отправке)
craig at craigfrancis dot co dot uk ¶
11 years ago
If your version of PHP does not include this function:
<?phpif (!function_exists('http_response_code')) {
function http_response_code($code = NULL) {
if (
$code !== NULL) {
switch (
$code) {
case 100: $text = 'Continue'; break;
case 101: $text = 'Switching Protocols'; break;
case 200: $text = 'OK'; break;
case 201: $text = 'Created'; break;
case 202: $text = 'Accepted'; break;
case 203: $text = 'Non-Authoritative Information'; break;
case 204: $text = 'No Content'; break;
case 205: $text = 'Reset Content'; break;
case 206: $text = 'Partial Content'; break;
case 300: $text = 'Multiple Choices'; break;
case 301: $text = 'Moved Permanently'; break;
case 302: $text = 'Moved Temporarily'; break;
case 303: $text = 'See Other'; break;
case 304: $text = 'Not Modified'; break;
case 305: $text = 'Use Proxy'; break;
case 400: $text = 'Bad Request'; break;
case 401: $text = 'Unauthorized'; break;
case 402: $text = 'Payment Required'; break;
case 403: $text = 'Forbidden'; break;
case 404: $text = 'Not Found'; break;
case 405: $text = 'Method Not Allowed'; break;
case 406: $text = 'Not Acceptable'; break;
case 407: $text = 'Proxy Authentication Required'; break;
case 408: $text = 'Request Time-out'; break;
case 409: $text = 'Conflict'; break;
case 410: $text = 'Gone'; break;
case 411: $text = 'Length Required'; break;
case 412: $text = 'Precondition Failed'; break;
case 413: $text = 'Request Entity Too Large'; break;
case 414: $text = 'Request-URI Too Large'; break;
case 415: $text = 'Unsupported Media Type'; break;
case 500: $text = 'Internal Server Error'; break;
case 501: $text = 'Not Implemented'; break;
case 502: $text = 'Bad Gateway'; break;
case 503: $text = 'Service Unavailable'; break;
case 504: $text = 'Gateway Time-out'; break;
case 505: $text = 'HTTP Version not supported'; break;
default:
exit('Unknown http status code "' . htmlentities($code) . '"');
break;
}$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');header($protocol . ' ' . $code . ' ' . $text);$GLOBALS['http_response_code'] = $code;
} else {
$code = (isset($GLOBALS['http_response_code']) ? $GLOBALS['http_response_code'] : 200);
}
return
$code;
}
}
?>
In this example I am using $GLOBALS, but you can use whatever storage mechanism you like... I don't think there is a way to return the current status code:
https://bugs.php.net/bug.php?id=52555
For reference the error codes I got from PHP's source code:
http://lxr.php.net/opengrok/xref/PHP_5_4/sapi/cgi/cgi_main.c#354
And how the current http header is sent, with the variables it uses:
http://lxr.php.net/opengrok/xref/PHP_5_4/main/SAPI.c#856
Stefan W ¶
8 years ago
Note that you can NOT set arbitrary response codes with this function, only those that are known to PHP (or the SAPI PHP is running on).
The following codes currently work as expected (with PHP running as Apache module):
200 – 208, 226
300 – 305, 307, 308
400 – 417, 422 – 424, 426, 428 – 429, 431
500 – 508, 510 – 511
Codes 0, 100, 101, and 102 will be sent as "200 OK".
Everything else will result in "500 Internal Server Error".
If you want to send responses with a freestyle status line, you need to use the `header()` function:
<?php header("HTTP/1.0 418 I'm A Teapot"); ?>
Thomas A. P. ¶
7 years ago
When setting the response code to non-standard ones like 420, Apache outputs 500 Internal Server Error.
This happens when using header(0,0,420) and http_response_code(420).
Use header('HTTP/1.1 420 Enhance Your Calm') instead.
Note that the response code in the string IS interpreted and used in the access log and output via http_response_code().
Anonymous ¶
9 years ago
Status codes as an array:
<?php
$http_status_codes = array(100 => "Continue", 101 => "Switching Protocols", 102 => "Processing", 200 => "OK", 201 => "Created", 202 => "Accepted", 203 => "Non-Authoritative Information", 204 => "No Content", 205 => "Reset Content", 206 => "Partial Content", 207 => "Multi-Status", 300 => "Multiple Choices", 301 => "Moved Permanently", 302 => "Found", 303 => "See Other", 304 => "Not Modified", 305 => "Use Proxy", 306 => "(Unused)", 307 => "Temporary Redirect", 308 => "Permanent Redirect", 400 => "Bad Request", 401 => "Unauthorized", 402 => "Payment Required", 403 => "Forbidden", 404 => "Not Found", 405 => "Method Not Allowed", 406 => "Not Acceptable", 407 => "Proxy Authentication Required", 408 => "Request Timeout", 409 => "Conflict", 410 => "Gone", 411 => "Length Required", 412 => "Precondition Failed", 413 => "Request Entity Too Large", 414 => "Request-URI Too Long", 415 => "Unsupported Media Type", 416 => "Requested Range Not Satisfiable", 417 => "Expectation Failed", 418 => "I'm a teapot", 419 => "Authentication Timeout", 420 => "Enhance Your Calm", 422 => "Unprocessable Entity", 423 => "Locked", 424 => "Failed Dependency", 424 => "Method Failure", 425 => "Unordered Collection", 426 => "Upgrade Required", 428 => "Precondition Required", 429 => "Too Many Requests", 431 => "Request Header Fields Too Large", 444 => "No Response", 449 => "Retry With", 450 => "Blocked by Windows Parental Controls", 451 => "Unavailable For Legal Reasons", 494 => "Request Header Too Large", 495 => "Cert Error", 496 => "No Cert", 497 => "HTTP to HTTPS", 499 => "Client Closed Request", 500 => "Internal Server Error", 501 => "Not Implemented", 502 => "Bad Gateway", 503 => "Service Unavailable", 504 => "Gateway Timeout", 505 => "HTTP Version Not Supported", 506 => "Variant Also Negotiates", 507 => "Insufficient Storage", 508 => "Loop Detected", 509 => "Bandwidth Limit Exceeded", 510 => "Not Extended", 511 => "Network Authentication Required", 598 => "Network read timeout error", 599 => "Network connect timeout error");
?>
Source: Wikipedia "List_of_HTTP_status_codes"
viaujoc at videotron dot ca ¶
2 years ago
Do not mix the use of http_response_code() and manually setting the response code header because the actual HTTP status code being returned by the web server may not end up as expected. http_response_code() does not work if the response code has previously been set using the header() function. Example:
<?php
header('HTTP/1.1 401 Unauthorized');
http_response_code(403);
print(http_response_code());
?>
The raw HTTP response will be (notice the actual status code on the first line does not match the printed http_response_code in the body):
HTTP/1.1 401 Unauthorized
Date: Tue, 24 Nov 2020 13:49:08 GMT
Server: Apache
Connection: Upgrade, Keep-Alive
Keep-Alive: timeout=5, max=100
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
403
I only tested it on Apache. I am not sure if this behavior is specific to Apache or common to all PHP distributions.
Anonymous ¶
8 years ago
You can also create a enum by extending the SplEnum class.
<?php/** HTTP status codes */
class HttpStatusCode extends SplEnum {
const __default = self::OK;
const
SWITCHING_PROTOCOLS = 101;
const OK = 200;
const CREATED = 201;
const ACCEPTED = 202;
const NONAUTHORITATIVE_INFORMATION = 203;
const NO_CONTENT = 204;
const RESET_CONTENT = 205;
const PARTIAL_CONTENT = 206;
const MULTIPLE_CHOICES = 300;
const MOVED_PERMANENTLY = 301;
const MOVED_TEMPORARILY = 302;
const SEE_OTHER = 303;
const NOT_MODIFIED = 304;
const USE_PROXY = 305;
const BAD_REQUEST = 400;
const UNAUTHORIZED = 401;
const PAYMENT_REQUIRED = 402;
const FORBIDDEN = 403;
const NOT_FOUND = 404;
const METHOD_NOT_ALLOWED = 405;
const NOT_ACCEPTABLE = 406;
const PROXY_AUTHENTICATION_REQUIRED = 407;
const REQUEST_TIMEOUT = 408;
const CONFLICT = 408;
const GONE = 410;
const LENGTH_REQUIRED = 411;
const PRECONDITION_FAILED = 412;
const REQUEST_ENTITY_TOO_LARGE = 413;
const REQUESTURI_TOO_LARGE = 414;
const UNSUPPORTED_MEDIA_TYPE = 415;
const REQUESTED_RANGE_NOT_SATISFIABLE = 416;
const EXPECTATION_FAILED = 417;
const IM_A_TEAPOT = 418;
const INTERNAL_SERVER_ERROR = 500;
const NOT_IMPLEMENTED = 501;
const BAD_GATEWAY = 502;
const SERVICE_UNAVAILABLE = 503;
const GATEWAY_TIMEOUT = 504;
const HTTP_VERSION_NOT_SUPPORTED = 505;
}
divinity76 at gmail dot com ¶
2 years ago
if you need a response code not supported by http_response_code(), such as WebDAV / RFC4918's "HTTP 507 Insufficient Storage", try:
<?php
header($_SERVER['SERVER_PROTOCOL'] . ' 507 Insufficient Storage');
?>
result: something like
HTTP/1.1 507 Insufficient Storage
Rob Zazueta ¶
9 years ago
The note above from "Anonymous" is wrong. I'm running this behind the AWS Elastic Loadbalancer and trying the header(':'.$error_code...) method mentioned above is treated as invalid HTTP.
The documentation for the header() function has the right way to implement this if you're still on < php 5.4:
<?php
header("HTTP/1.0 404 Not Found");
?>
Anonymous ¶
10 years ago
If you don't have PHP 5.4 and want to change the returned status code, you can simply write:
<?php
header(':', true, $statusCode);
?>
The ':' are mandatory, or it won't work
Richard F. ¶
9 years ago
At least on my side with php-fpm and nginx this method does not change the text in the response, only the code.
<?php// HTTP/1.1 404 Not Found
http_response_code(404);?>
The resulting response is HTTP/1.1 404 OK
Steven ¶
7 years ago
http_response_code is basically a shorthand way of writing a http status header, with the added bonus that PHP will work out a suitable Reason Phrase to provide by matching your response code to one of the values in an enumeration it maintains within php-src/main/http_status_codes.h. Note that this means your response code must match a response code that PHP knows about. You can't create your own response codes using this method, however you can using the header method.
In summary - The differences between "http_response_code" and "header" for setting response codes:
1. Using http_response_code will cause PHP to match and apply a Reason Phrase from a list of Reason Phrases that are hard-coded into the PHP source code.
2. Because of point 1 above, if you use http_response_code you must set a code that PHP knows about. You can't set your own custom code, however you can set a custom code (and Reason Phrase) if you use the header method.
stephen at bobs-bits dot com ¶
8 years ago
It's not mentioned explicitly, but the return value when SETTING, is the OLD status code.
e.g.
<?php
$a
= http_response_code();
$b = http_response_code(202);
$c = http_response_code();var_dump($a, $b, $c);// Result:
// int(200)
// int(200)
// int(202)
?>
Anonymous ¶
4 years ago
http_response_code() does not actually send HTTP headers, it only prepares the header list to be sent later on.
So you can call http_reponse_code() to set, get and reset the HTTP response code before it gets sent.
Test code:
<php
http_response_code(500); // set the code
var_dump(headers_sent()); // check if headers are sent
http_response_code(200); // avoid a default browser page
Chandra Nakka ¶
5 years ago
On PHP 5.3 version, If you want to set HTTP response code. You can try this type of below trick :)
<?php
header
('Temporary-Header: True', true, 404);
header_remove('Temporary-Header');?>
yefremov {dot} sasha () gmail {dot} com ¶
8 years ago
@craig at craigfrancis dot co dot uk@ wrote the function that replaces the original. It is very usefull, but has a bug. The original http_response_code always returns the previous or current code, not the code you are setting now. Here is my fixed version. I also use $GLOBALS to store the current code, but trigger_error() instead of exit. So now, how the function will behave in the case of error lies on the error handler. Or you can change it back to exit().
if (!function_exists('http_response_code')) {
function http_response_code($code = NULL) {
$prev_code = (isset($GLOBALS['http_response_code']) ? $GLOBALS['http_response_code'] : 200);
if ($code === NULL) {
return $prev_code;
}
switch ($code) {
case 100: $text = 'Continue'; break;
case 101: $text = 'Switching Protocols'; break;
case 200: $text = 'OK'; break;
case 201: $text = 'Created'; break;
case 202: $text = 'Accepted'; break;
case 203: $text = 'Non-Authoritative Information'; break;
case 204: $text = 'No Content'; break;
case 205: $text = 'Reset Content'; break;
case 206: $text = 'Partial Content'; break;
case 300: $text = 'Multiple Choices'; break;
case 301: $text = 'Moved Permanently'; break;
case 302: $text = 'Moved Temporarily'; break;
case 303: $text = 'See Other'; break;
case 304: $text = 'Not Modified'; break;
case 305: $text = 'Use Proxy'; break;
case 400: $text = 'Bad Request'; break;
case 401: $text = 'Unauthorized'; break;
case 402: $text = 'Payment Required'; break;
case 403: $text = 'Forbidden'; break;
case 404: $text = 'Not Found'; break;
case 405: $text = 'Method Not Allowed'; break;
case 406: $text = 'Not Acceptable'; break;
case 407: $text = 'Proxy Authentication Required'; break;
case 408: $text = 'Request Time-out'; break;
case 409: $text = 'Conflict'; break;
case 410: $text = 'Gone'; break;
case 411: $text = 'Length Required'; break;
case 412: $text = 'Precondition Failed'; break;
case 413: $text = 'Request Entity Too Large'; break;
case 414: $text = 'Request-URI Too Large'; break;
case 415: $text = 'Unsupported Media Type'; break;
case 500: $text = 'Internal Server Error'; break;
case 501: $text = 'Not Implemented'; break;
case 502: $text = 'Bad Gateway'; break;
case 503: $text = 'Service Unavailable'; break;
case 504: $text = 'Gateway Time-out'; break;
case 505: $text = 'HTTP Version not supported'; break;
default:
trigger_error('Unknown http status code ' . $code, E_USER_ERROR); // exit('Unknown http status code "' . htmlentities($code) . '"');
return $prev_code;
}
$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');
header($protocol . ' ' . $code . ' ' . $text);
$GLOBALS['http_response_code'] = $code;
// original function always returns the previous or current code
return $prev_code;
}
}
Kubo2 ¶
6 years ago
If you want to set a HTTP response code without the need of specifying a protocol version, you can actually do it without http_response_code():
<?php
header
('Status: 404', TRUE, 404);?>
zweibieren at yahoo dot com ¶
7 years ago
The limited list given by Stefan W is out of date. I have just tested 301 and 302 and both work.
divinity76 at gmail dot com ¶
6 years ago
warning, it does not check if headers are already sent (if it is, it won't *actually* change the code, but a subsequent call will imply that it did!!),
you might wanna do something like
function ehttp_response_code(int $response_code = NULL): int {
if ($response_code === NULL) {
return http_response_code();
}
if (headers_sent()) {
throw new Exception('tried to change http response code after sending headers!');
}
return http_response_code($response_code);
}
На сервере используется nginx, я отправляю ответ user’у так:
file index.php
<?
header('HTTP/1.1 403 incorrect user');
Но когда открываю эту страницу, то не вижу ответа.
Делал так:
since PHP 5.4.0 there is a spezialized function for that http_response_code() i.e.:
<?php
http_response_code(404);
?>
То же, просто белая страница, пустая внутри. Или я не должен видеть этой ошибки в браузере?
-
Вопрос заданболее трёх лет назад
-
3835 просмотров
Не должны. Сообщение об ошибке, которое отображается в окне браузера, надо выдавать самому, отдельно от заголовков.
header('HTTP/1.1 403 incorrect user');
echo 'Incorrect user';
Пригласить эксперта
Так она и должна бьіть белой.
Вам же на сайтах не маячит на всех страницах 200 ОК
Смотрите заголовки:
i.imgur.com/UoEsncT.png
Как реализовать?
Так, как ты реализуешь. Главное чтобы заголовки отправлялись до начала вывода и не был подавлен вывод ошибок.
Или я не должен видеть этой ошибки в браузере?
Должен.
То же, просто белая страница, пустая внутри.
Как уже сказали — смотри код ответа пришедший от сервера.
Если там 200 — смотри конфиг нжинкса
-
Показать ещё
Загружается…
29 янв. 2023, в 03:07
300000 руб./за проект
29 янв. 2023, в 02:16
700000 руб./за проект
29 янв. 2023, в 01:54
5000 руб./за проект
Минуточку внимания
Я знаю, что вы можете отправить заголовок, который сообщает браузеру, что эта страница запрещена:
Но как я могу также отобразить страницу пользовательской ошибки, которая была создана на сервере для такого типа ошибок?
По умолчанию просто отправка заголовка отображает белую страницу, но я помню некоторое время назад, чтобы прочитать страницу ошибки клиента. Кто-нибудь знает?
Включите страницу пользовательской ошибки после изменения заголовка.
Просто эхом ваш контент после отправки заголовка.
header('HTTP/1.0 403 Forbidden'); echo 'You are forbidden!';

Для этого вы должны сначала сказать браузеру, что пользователь получил ошибку 403. Для этого вы можете использовать этот код:
header("HTTP/1.1 403 Forbidden" );
Затем сценарий отправляет «ошибку, ошибку, ошибку, ошибку, ошибку …….», поэтому вы должны ее остановить. Вы можете использовать
exit;
С помощью этих двух строк сервер отправляет ошибку и останавливает скрипт.
Не забывайте: эмулируйте ошибку, но вы должны установить ее в файле .htaccess, с
ErrorDocument 403 /error403.php
http_response_code был представлен в PHP 5.4 и сделал все намного проще!
http_response_code(403); die('Forbidden');
.htaccess
ErrorDocument 403 /403.html
Посмотрите много ответов, но правильный – предоставить полные опции для вызова функции заголовка в соответствии с руководством по php
void header ( string $string [, bool $replace = true [, int $http_response_code ]] )
Если вы вызываете
header('HTTP/1.0 403 Forbidden', true, 403);
нормальное поведение HTTP 403, настроенное с помощью Apache или любого другого сервера.
Чтобы свести к минимуму обязанности сервера, сделайте его простым:
.htaccess
ErrorDocument 403 "Forbidden"
PHP
header('HTTP/1.0 403 Forbidden'); die(); // or your message: die('Forbidden');
Используйте ModRewrite:
RewriteRule ^403.html$ - [F]
Просто убедитесь, что вы создали пустой документ под названием «403.html» в своем корневом каталоге www или получите ошибку 404 вместо 403.
Я прочитал все ответы здесь, и ни один из них не был полным ответом для моей ситуации (что точно так же в этом вопросе), вот как я собрал некоторые части предлагаемых ответов и придумал точное решение:
- Приземлитесь на настоящую 403 страницу вашего сервера. (Перейдите на запрещенный URL-адрес на своем сервере или перейдите на любую 403 страницу, которая вам нравится)
- Щелкните правой кнопкой мыши и выберите «источник просмотра». Выберите весь источник и сохраните его в файле в вашем домене, например: http://domain.com/403.html.
- теперь перейдите на свою настоящую запретную страницу (или запретную ситуацию в какой-то части вашего php): http://domain.com/members/this_is_forbidden.php
-
echo этот код ниже перед любым выходом или заголовком HTML! (даже пробелы заставят PHP отправлять HTML / TEXT HTTP Header, и это не сработает) Код ниже должен быть вашей первой строкой !
<?php header('HTTP/1.0 403 Forbidden'); $contents = file_get_contents('/home/your_account/public_html/domain.com/403.html', TRUE); exit($contents);
Теперь у вас есть точное решение. Я проверил и проверил с последними посетителями CPANEL и зарегистрировался как точное событие 403.
Я понимаю, что у вас есть сценарий с ErrorDocument, уже определенный в вашем apache conf или .htaccess, и вы хотите, чтобы эти страницы отображались при ручной отправке кода состояния 4xx через php.
К сожалению, это невозможно с распространенными методами, потому что php отправляет заголовок непосредственно в браузер пользователя (а не на веб-сервер Apache), тогда как ErrorDocument – это обработчик отображения для http-статуса, сгенерированного из Apache.
Обновите страницу после отправки 403:
<?php header('HTTP/1.0 403 Forbidden'); ?> <html><head> <meta http-equiv="refresh" content="0;URL=http://my.error.page"> </head><body></body></html>
Алекс, вы можете перенаправить на свою страницу с помощью заголовка, подобного этому:
header('Location: my403page.html');
И убедитесь, что на вашей странице 403 вы включаете исходный код заголовка:
header('HTTP/1.0 403 Forbidden');
Кроме того, вы можете просто создать заголовок и включить страницу 403 следующим образом:
header('HTTP/1.0 403 Forbidden'); include('my403page.html');
5
19
Все уже наверно сталкивались с ситуацией, когда при посещении какого-либо сайта выскакивает надпись
Forbidden You don’t have permission to access on this server и нужный сайт не загружается.
Данная ситуация возможна в том случае, если Вы пытаетесь обратиться к ресурсам сайта, доступ к которым запрещен,
либо Ваш IP адрес был забанен на данном сайте. В данном случае код ответа сервера будет равен 403. Проще говоря, сервер возвращает
ошибку 403 (или страничку 403).
В данной теме мы предлагаем Вам создать свою собственную страничку 403 для отслеживания активности заблокированных
IP адресов и IP адресов, пытающихся обратиться к ресурсам, доступ к которым закрыт.
Своя собственная страничка 403 может быть полезна для тех, кто хочет знать, прекратились ли обращения к
страницам сайта с забаненных IP адресов или нет, и кто пытается получить доступ к файлам с ограниченным доступом.
Для начала, давайте посмотрим, как выглядит исходный код странички, которая появляется при попытке доступа к
файлу .htaacces:
HTML код:
<!DOCTYPE html>
<html lang="en"><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /.htaacces
on this server.</p>
</body></html>
Для создания своей собственной странички 403, создайте файл (например, error403.php). Внутрь данного файла поместите выше
приведенный HTML код с сообщением, после которого добавьте PHP код, который будет писать логи:
PHP код:
<?php
if (filesize("logs_403.txt")<99999) {
$fh=fopen("logs_403.txt","a+");
flock($fh,LOCK_EX);
fseek($fh,0);
while (!feof($fh)) $str.=fread($fh,8192);
$str.=date("H:i:s d m Y")." | ".htmlspecialchars($_SERVER['REMOTE_ADDR']." | ".
$_SERVER['HTTP_USER_AGENT']." | ".$_SERVER['REQUEST_URI']."rn");
ftruncate($fh,0);
fwrite($fh,$str);
flock($fh,LOCK_UN);
fclose($fh);
}
?>
Для того чтобы страничка 403 стала универсальной и выдавала в сообщение URL, к которому закрыт доступ,
в HTML коде замените строчку <p>You don’t have permission to access /.htaacces на
<p>You don’t have permission to access /<?php echo strtok(basename($_SERVER[‘REQUEST_URI’]), ‘?’).’ ‘;?>
Теперь Вам остается лишь перенаправить посетителя со стандартной странички 403 на Вашу собственную.
Для этого в файле .htaccess добавьте всего одну строчку:
Цитата:
ErrorDocument 403 /error403.php
Все. Теперь все IP адреса, доступ которым запрещен на сайт и IP адреса, которые пытаются получить доступ к защищенным
ресурсам сайта, будут попадать в файл логов logs_403.txt с указанием времени, User_Agent-а и URL, по которому они пытались получить доступ.
Обращаем Ваше внимание на то, что мы специально добавили в PHP код дополнительное условие проверки
if (filesize(«logs_403.txt»)<99999) для того, чтобы при быстром росте размера файла логов и превышении им
размера в 99999 байт, логи в файл перестали записываться для снижения нагрузки на сервер.
При всем при этом стоит учитывать, что предлагаемая нами собственная страничка 403 при очень частом
обращении к ней повысит нагрузку на сервер, так что смотрите сами, стоит ли Вам создавать свою собственную страничку ошибки
403 если сервер у Вас слабый.
Дата создания: 16:12:47 13.06.2013 г.
Посещений: 7726 раз(а).
Перед публикацией все комментарии проходят обязательную модерацию!
Если Вы хотите задать какой-либо вопрос, то сделайте это на нашем форуме.
Таким образом, Вы сможете быстрее получить ответ на интересующий Вас вопрос.
Website error pages are perhaps one of the most overlooked pieces of a fully rounded website. Not only are they important but they give you the opportunity to have a little fun. Although many web developers rely on server logs to keep an eye out for hits on error pages, I’m going to take a different approach by using a PHP generated email. In addition, we will spice up the design a bit, add basic navigation and link to the website sitemap.
About Error Pages


The most common error page — the one in which you are most likely to be familiar with — is the «404 Not Found page». More people encounter this type of error page than any other. Other common error messages you may have come across are 500 Internal Server Error, 400 Bad Request or 403 Forbidden. Wondering what the number is for? It simply refers to the HTTP code.


Default error pages are quite boring (as you can see above) and offer no purpose to visitors other than letting them know some boring error happened. For these reasons, it is a great idea to provide custom pages for the most common errors encountered. This tutorial will only cover two: the «404 Not Found» and «403 Forbidden».
Check for custom error page support
First, check to make sure your hosting provider allows you to use your own error pages. Almost all of them do, and most of them even provide a configuration area within your control panel to help you quickly create the pages. In this tutorial we will configure an Apache web server (the most common). This is easier than you might think.
Configure .htaccess
Next, connect to your server via FTP or control panel and navigate to the document root directory (usually www or public_html) which contains your website files. We will be looking for the .htaccess file. It is sometimes hidden so make sure you are viewing all files including hidden ones. If your server doesn’t have one, you can create one using any text editor. Make sure to make a backup of the .htaccess file if your server already has one.
Add the following lines to your .htaccess file:
1 |
ErrorDocument 404 /error/404.php |
2 |
ErrorDocument 403 /error/403.php |
The first half (ErrorDocument 404) is telling the server we are going to define the location of the 404 error document. The second half defines the actual location of the error document. In this case we will put it in the «error» directory and call them 404.php and 403.php, respectively.
Now save the .htaccess file and upload it to the document root directory.
Design the Custom Error Pages
It is best to stay with the same design as your website already uses so that you don’t confuse your visitors and risk losing them. You should also include helpful elements such as a polite error message, suggested links, a search feature, or a link to your sitemap. These features will depend on the level of content your website provides and what you feel will be most helpful.


As you can see below, the 404 Not Found page for Nettuts+ has stated the error and emphasized the search feature by including it in the body beneath the error message. You could take this a step further by including a short list of links to possible pages which might encourage the visitor to continue exploring more of the site (keep it simple and short though) -or even a humorous image (every one likes laughing right?). For small websites it may be a good idea to include a visible sitemap as well.


Here is something I put together for this tutorial that you can use for your website as well (included in the download above). It’s very simple so you will be able to put the content of it directly into your existing website template. As you can see, I attempted to include a little bit of a humorous element while also stating the error politely and including some options to help the visitor either find what they were looking for or continue browsing the website.


You’ll notice it does not specify the HTTP error code in the body of the page. Instead I chose to only use the error code in the title of the page. The reason for this is to keep things as simple and user friendly as possible. Most people don’t care what 404 or 403 means, they want to know what’s going on in plain English. For people who want the error code, it is still available via the title.
If you want to see some really great 404 designs visit:
- http://www.smashingmagazine.com/2009/01/29/404-error-pages-reloaded-2/
- http://www.smashingmagazine.com/2007/08/17/404-error-pages-reloaded/
- http://www.smashingmagazine.com/2007/07/25/wanted-your-404-error-pages/
- http://blogof.francescomugnai.com/2008/08/the-100-most-funny-and-unusual-404-error-pages/
The Auto-Mailer PHP and Why We Will Use Email Notification
This is the part of the tutorial in which some web guru’s might argue with. You can use your web server’s logs to check for error pages and much, much more. Why do I choose email notifications?
- I don’t want to log into my server every day and dig through all that extra information.
- I am available by email almost literally all day, the fastest way to reach me is email (or twitter). With this in mind, I want to know about 404 and 403 errors fairly quick so email is best.
- An increasing number of people are starting websites, while most of those people know almost nothing about web hosting let alone server logs. These people will only be running small sites; so email is ideal.
- Being notified right away allows me to quickly take action if a website of mine is being «harvested» (ThemeForest templates), if someone is attempting to access something restricted repeatedly or if I have a broken link somewhere.
So with all that said, let’s get on with the code shall we!
The Code
First, we will create a file named error-mailer.php which will be used to collect information about our visitor and send the email. Once you have created the file we will start by specifying our email and email settings.
1 |
<?php
|
2 |
|
3 |
# The email address to send to
|
4 |
$to_email = 'YOUR-EMAIL@DOMAIN.com'; |
5 |
|
6 |
# The subject of the email, currently set as 404 Not Found Error or 403 Forbidden Error
|
7 |
$email_subject = $error_code.' Error'; |
8 |
|
9 |
# The email address you want the error to appear from
|
10 |
$from_email = 'FROM-EMAIL@DOMAIN.COM'; |
11 |
|
12 |
# Who or where you want the error to appear from
|
13 |
$from_name = 'YourDomainName.com'; |
Then we will collect information about our visitor such as IP address, requested URI, User Agent, etc. The following code will collect that information.
1 |
# Gather visitor information
|
2 |
$ip = getenv ("REMOTE_ADDR"); // IP Address |
3 |
$server_name = getenv ("SERVER_NAME"); // Server Name |
4 |
$request_uri = getenv ("REQUEST_URI"); // Requested URI |
5 |
$http_ref = getenv ("HTTP_REFERER"); // HTTP Referer |
6 |
$http_agent = getenv ("HTTP_USER_AGENT"); // User Agent |
7 |
$error_date = date("D M j Y g:i:s a T"); // Error Date |
Now we will write the script to email the information to us with the details specified earlier.
1 |
# Send the email notification
|
2 |
require_once('phpMailer/class.phpmailer.php'); |
3 |
$mail = new PHPMailer(); |
4 |
|
5 |
$mail->From = $from_email; |
6 |
$mail->FromName = $from_name; |
7 |
$mail->Subject = $email_subject; |
8 |
$mail->AddAddress($to_email); |
9 |
$mail->Body = |
10 |
"There was a ".$error_code." error on the ".$server_name." domain". |
11 |
"nnDetailsn----------------------------------------------------------------------". |
12 |
"nWhen: ".$error_date. |
13 |
"n(Who) IP Address: ".$ip. |
14 |
"n(What) Tried to Access: http://".$server_name.$request_uri. |
15 |
"n(From where) HTTP Referer: ".$http_ref. |
16 |
"nnUser Agent: ".$http_agent; |
17 |
|
18 |
$mail->Send(); |
19 |
|
20 |
?>
|
We are using the phpMailer class to do this as demonstrated by Jeffrey via the ThemeForest blog to create a nice AJAX contact form. This version of the phpMailer class is for PHP 5/6 so if your server is running PHP 4 you will need to use the corresponding version by downloading it here.
404.php and 403.php Error Pages
The last thing we need to do is customize the error pages we designed earlier by sending the proper headers and set the $error_code variable by inserting the following code at the beginning of each page respectively (separated by ——-).
1 |
<?php
|
2 |
|
3 |
header("HTTP/1.0 404 Not Found"); |
4 |
$error_code = '404 Not Found'; // Specify the error code |
5 |
require_once('error-mailer.php'); // Include the error mailer script |
6 |
|
7 |
?>
|
8 |
------- |
9 |
<?php
|
10 |
|
11 |
header("HTTP/1.0 403 Forbidden"); |
12 |
$error_code = '403 Forbidden'; // Specify the error code |
13 |
require_once('error-mailer.php'); // Include the error mailer script |
14 |
|
15 |
?>
|
What we are doing here first is setting the correct HTTP header to return 404 Not Found and 403 Forbidden, respectively. When search engines accidentally land on this page we want to make sure they know what kind of page it is, instead of thinking that it’s a normal web page named 404.php or 403.php.
Then we specify the error code to be used in the mailer script and include the mailer script so it can do its work. This way if we make a change to the mailer script, we only need to edit one file instead of two or more (if you setup additional custom error pages).
Conclusion
There you have it! Your own custom error pages that are search engine friendly, and let you know via email when you’ve had a visitor as well as all the information you will need to fix any problems. A few last things to consider:
- Internet Explorer requires error pages that are at least 512 byes in size (if you use the example files you’ll be fine)
- High traffic websites have the potential to generate A LOT of emails so make sure you setup some sort of email filter for these error notifications so they don’t flood your inbox. I use Gmail so I just have a label and filter setup for these emails.
Did you find this post useful?
![]()
I’m a freelance designer and web developer, an author and reviewer at ThemeForest.net, a writer for the ThemeForest blog and occasionally net.tutsplus.com. When I actually manage to get away from the computer, I’m hiking, watching movies or spending time with my girlfriend in sunny Las Vegas. – View my web.appstorm.net posts here.
Я создал php-скрипт, который иногда может возвращать серверу сообщение об ошибке 403 (запрещенный доступ) из-за длины и содержания данных, отправленных через метод $_POST. Это сообщение об ошибке 403 возвращается из-за некоторых правил mod_secure, которые фильтруют данные, отправляемые на сервер.
Возможно ли, чтобы PHP обрабатывал это сообщение об ошибке 403? Например, я хотел бы перехватывать состояние сервера при запуске своего сценария, а затем отображать сообщение об ошибке, когда сервер возвращает код состояния 403. Возможно ли это сделать в PHP?
Другими словами, не делая перенаправления, я просто хотел бы отображать на текущей странице пользовательское сообщение, если сервер возвращает код состояния 403 при выполнении самого PHP-скрипта.
Спасибо за вашу помощь
2 ответы
Это было бы создание пользовательского документа об ошибках 403 в Apache и указание его на скрипт для обработки ошибки. Обратитесь к ErrorDocument документацию о том, как это сделать, но это будет что-то вроде этого:
ErrorDocument 403 /custom_403_handler.php
ответ дан 09 авг.
Итак, у меня есть три возможных решения для вас.
-
Проверьте наличие ошибок URL и убедитесь, что указана фактическая веб-страница. Распространенная причина, по которой веб-сайт возвращает ошибку 403 Forbidden, когда URL-адрес указывает на каталог, а не на веб-страницу. Это можно сделать с помощью класса HttpRequest в PHP. Ты можешь использовать http_get выполнить GET-запрос. Вы также можете Тестовый URL здесь.
<?php $response = http_get("URL", array("timeout"=>1), $info); print_r($info); ?>Вывод:
array ( 'effective_url' => 'URL', 'response_code' => 403, . and so on )Что для вас важно, так это response_code, с которым вы можете играть дальше.
-
Использование завитка.
function http_response($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, TRUE); curl_setopt($ch, CURLOPT_NOBODY, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $head = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if(!$head) { return FALSE; } return $httpCode; } $errorcode = http_response("URL"); //if success 200 otherwise different -
Если вы уверены, что страница, которую вы пытаетесь открыть, верна, сообщение об ошибке 403 Forbidden может быть ошибкой. Тогда вы можете сделать только две вещи: связаться с веб-мастером или использовать собственное перенаправление. Для этого добавьте следующую строку в файл .htaccess и обработайте эту ошибку в disabled.php.
ErrorDocument 403 /forbidden.php
ответ дан 09 авг.
Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками
php
http-status-code-403
or задайте свой вопрос.
12 ответов
Включите страницу пользовательской ошибки после изменения заголовка.
Ibrahim AshShohail
21 фев. 2011, в 03:11
Поделиться
Просто отправьте эхо ваш контент после отправки заголовка.
header('HTTP/1.0 403 Forbidden');
echo 'You are forbidden!';

alex
21 фев. 2011, в 04:05
Поделиться
Для этого вы должны сначала сказать браузеру, что пользователь получил ошибку 403. Для этого вы можете использовать этот код:
header("HTTP/1.1 403 Forbidden" );
Затем script отправить «ошибку, ошибку, ошибку, ошибку, ошибку…….», поэтому вы должны ее остановить. Вы можете использовать
exit;
С помощью этих двух строк сервер отправит ошибку и остановит script.
Не забывайте: эмулируйте ошибку, но вы должны установить ее в файле .htaccess,
ErrorDocument 403 /error403.php
Pyrrha
18 апр. 2013, в 19:17
Поделиться
http_response_code был введен в PHP 5.4 и упростил ситуацию!
http_response_code(403);
die('Forbidden');
Marcio Mazzucato
25 апр. 2017, в 15:50
Поделиться
Посмотрите много ответов, но правильный — предоставить полные опции для вызова функции заголовка в соответствии с руководством по php
void header ( string $string [, bool $replace = true [, int $http_response_code ]] )
Если вы вызываете
header('HTTP/1.0 403 Forbidden', true, 403);
будет следовать нормальное поведение HTTP 403, настроенного с помощью Apache или любого другого сервера.
Jiju Thomas Mathew
11 дек. 2016, в 05:21
Поделиться
.htaccess
ErrorDocument 403 /403.html
user557846
21 фев. 2011, в 03:44
Поделиться
Я прочитал все ответы здесь, и ни один из них не был полным ответом на мою ситуацию (что точно так же в этом вопросе), вот как я собрал некоторые части предлагаемых ответов и придумал точное решение:
- Земля на вашем сервере реальная 403 страница. (Перейдите на запрещенный URL-адрес вашего сервера или перейдите на любую 403-страничную страницу)
- Щелкните правой кнопкой мыши и выберите «источник просмотра». Выберите весь источник и сохраните его в файл в своем домене, например: http://domain.com/403.html
- теперь перейдите на свою настоящую запрещенную страницу (или запретную ситуацию в некоторой части вашего php): http://domain.com/members/this_is_forbidden.php
-
повторите этот код ниже до любого вывода или заголовка HTML! (даже пробелы заставят PHP отправлять HTML/TEXT HTTP Header, и это не сработает)
Код ниже должен быть вашей первой строкой!<?php header('HTTP/1.0 403 Forbidden'); $contents = file_get_contents('/home/your_account/public_html/domain.com/403.html', TRUE); exit($contents);
Теперь у вас есть точное решение. Я проверил и проверил с последними посетителями CPANEL и зарегистрировался как точное событие 403.
Tarik
06 окт. 2015, в 19:03
Поделиться
Используйте ModRewrite:
RewriteRule ^403.html$ - [F]
Просто убедитесь, что вы создали пустой документ под названием «403.html» в своем корневом каталоге www или получите ошибку 404 вместо 403.
Jay Sudo
02 фев. 2015, в 00:04
Поделиться
Чтобы свести к минимуму обязанности сервера, сделайте его простым:
.htaccess
ErrorDocument 403 "Forbidden"
PHP
header('HTTP/1.0 403 Forbidden');
die(); // or your message: die('Forbidden');
virtual_cia
05 фев. 2014, в 23:27
Поделиться
Я понимаю, что у вас есть сценарий с ErrorDocument, уже определенный в вашем apache conf или .htaccess, и вы хотите, чтобы эти страницы отображались при ручной отправке кода состояния 4xx через php.
К сожалению, это невозможно с распространенными методами, потому что php отправляет заголовок непосредственно в браузер пользователя (а не на веб-сервер Apache), тогда как ErrorDocument — обработчик отображения для статуса http, сгенерированного из Apache.
labemi
27 нояб. 2014, в 15:36
Поделиться
Обновите страницу после отправки 403:
<?php
header('HTTP/1.0 403 Forbidden');
?>
<html><head>
<meta http-equiv="refresh" content="0;URL=http://my.error.page">
</head><body></body></html>
Richard
12 окт. 2014, в 07:46
Поделиться
Алекс, вы можете перенаправить на свою страницу с помощью заголовка, подобного этому:
header('Location: my403page.html');
И убедитесь, что на вашей странице 403 вы указываете свой исходный код заголовка:
header('HTTP/1.0 403 Forbidden');
В качестве альтернативы вы можете просто создать заголовок и включить страницу 403 следующим образом:
header('HTTP/1.0 403 Forbidden');
include('my403page.html');
barners
20 дек. 2013, в 11:30
Поделиться
Ещё вопросы
- 1Python + Kivy (второй экран загружается пустым)
- 0Вторая часть моего кода не работает, и я новичок в использовании классов
- 0Клонирование объявлений AdSense с использованием jQuery
- 1Сравнение строк с использованием вложенных циклов
- 1Отправьте запрос GET HTTPS, но получите 403 запрещенного ответа, почему?
- 1ILNumerics: ILArray <T> в качестве переменных экземпляра;
- 1Разделение строки Java с регулярным выражением, игнорирующее содержимое в скобках
- 1Android Alarm Manager
- 0ngChange работает с массивом объектов
- 0Французский акцент в Angular
- 0отображать результаты множества отношений и группировать их по одному и тому же идентификатору
- 1Служебная заявка на запрос даты и времени десериализации — как заставить ее игнорировать текущую культуру?
- 0JQuery Datatables Pre Render Styling (отсутствует)
- 1Dask не может прочитать файл, а Pandas нет
- 1WPF MUI Как выгрузить пользовательский элемент управления и загрузить другой
- 0Как выбрать объект, используя его значение массива детей ..?
- 1Android я могу избежать вызова onCreate ()?
- 1Привязать значение к пользовательскому элементу управления внутри повторителя
- 1Пакетная компиляция с Maven?
- 0Используйте глобальную переменную
- 0Получить номер отдельной строки внутри строки
- 0Статическая переменная в области видимости файла
- 0Array — Удалить записи со значением ноль
- 0Google Static Map Image работает не на устройстве Tizen, а на эмуляторе
- 0Как читать строки из текстового файла в вектор для поиска?
- 0Заставить Google InfoWindow перерисовать себя или обновить его содержимое
- 0Массив объектов внутри класса
- 1Пакетная вставка из элемента управления Repeater с помощью флажка
- 1Добавление пользовательских данных в базу данных Firebase
- 1Порядок выполнения свойств элемента в xaml
- 0Как сделать список HTML прокручиваться вниз на полноэкранной странице?
- 0Стоит ли хранить количество таблиц в другой таблице?
- 1Преобразование в реальный формат JPEG 8bpp
- 1Прокрутка нескольких изображений в Android
- 0Получить приложение для входа в систему, MFC
- 1Снимок экрана синхронно
- 1Невозможно отобразить Google Map в моих приложениях для Android
- 0Перезагрузить страницу, чтобы показать вставленные элементы пользовательского интерфейса jQuery?
- 1Конвертировать карту лямбда в список понимания
- 0Symfony, Doctrine, merge не работают должным образом (в то время как сохраняются те же сущности)
- 0Вызов функции Javascript из мобильного тела HTML onorientationchange
- 0Как правильно сделать столбцы в адаптивном дизайне?
- 1Эффективный SQL-запрос один-ко-многим
- 1как реализовать приостановку обработчика для другого действия, выполняющего это действие
- 1Python / Pandas — помещает список диктов в DataFrame Pandas — Dict Keys должен быть столбцами
- 1Проблема с запуском первого Android Hello World на NetBeans
- 0Мой strcpy_s не будет работать с указателем char *, почему?
- 0JavaScript объект объект HTMLIFrameElement ошибка
- 0Подход для проверки всех текстовых полей с использованием Jquery validate
- 1как сказать egit игнорировать некоторые типы файлов