PHP-Fusion
v.7.01
AP-Fusion
v7.02.03
Pimped-Fusion-AP
v0.09.03
февраля 10 2012 14:43:23
Навигация
· Новости
· Статьи
· Скачать
· Форум
· Ссылки
· Категории новостей
· Обратная связь
· Галерея
· Поиск
· Гостевая
· Коллекция аватар
· CMS AP-Fusion. Отличия от PHP-Fusion
· Javascript справочник
· Разное
Сейчас на сайте
· Гостей: 2

· Пользователей: 0

· Всего пользователей: 441
· Новый пользователь: yak21
Информеры
Загрузка файлов  +  -
Бытовая техника:  +  
Лента alipapa.ru
Карпаты. Драгобрат.
Карпаты. Яремче, Яблунецкий перевал.
dbForge Studio for MySQL вместо PHPMyAdmin
Облачные технологии - насколько это серьезно?
Как распределяется вес по сайту
Совместимость CMS

Solomono.ru - сервис для веб-мастера
Микроразметка веб-страниц.
АГС - не приговор.
Немного о политике.

Что такое АГС и как с ним бороться?
Долгожданный АП PR
PR Google: 9 месяцев без апдейта

Поведенческий фактор - модная тенденция?
Wi-Fi дома. Что делать, если 192.168.0.1 занято?
Ускоренная переиндексация страниц в Яндексе

Как я ставил винду на нетбук.
ROOKEE - инструмент оптимизатора.
Строим рейтинг-каталог
Смайлики прошлого века
Ссылки  +  -
Блоги
Alipapa
» Блог Алипапы
lom
» Блог Лома
Последние активные темы форума
  Темы Просмотров Ответов Последние сообщения
Pimped-Fusion. Первые впеча...
Ошибки, баги, глюки
1688 79 Alipapa
10-02-2012 13:01
Произвольные Title на любой...
Вопросы по работе
44 1 Alipapa
07-02-2012 14:28
Мультикатегории в новостях
Моды, плагины
236 8 Alipapa
28-01-2012 00:47
AP-Fusion 7.02
Вопросы по работе
2708 29 Alipapa
18-01-2012 17:59
Расширенный каталог статей.
Моды, плагины
12065 167 Alipapa
14-12-2011 23:32

header

(PHP 3, PHP 4 , PHP 5)

header -- Send a raw HTTP header

Description

void header ( string string [, bool replace [, int http_response_code]] )

header() is used to send raw HTTP headers. See the HTTP/1.1 specification for more information on HTTP headers.

The optional replace parameter indicates whether the header should replace a previous similar header, or add a second header of the same type. By default it will replace, but if you pass in FALSE as the second argument you can force multiple headers of the same type. For example:

<?php
header
( 'WWW-Authenticate: Negotiate' );
header ( 'WWW-Authenticate: NTLM' , false );
?>

The second optional http_response_code force the HTTP response code to the specified value. (This parameter is available in PHP 4.3.0 and higher.)

There are two special-case header calls. The first is a header that starts with the string "HTTP/" (case is not significant), which will be used to figure out the HTTP status code to send. For example, if you have configured Apache to use a PHP script to handle requests for missing files (using the ErrorDocument directive), you may want to make sure that your script generates the proper status code.

<?php
header
( "HTTP/1.0 404 Not Found" );
?>

Замечание: The HTTP status header line will always be the first sent to the client, regardless of the actual header() call being the first or not. The status may be overridden by calling header() with a new status line at any time unless the HTTP headers have already been sent.

Замечание: In PHP 3, this only works when PHP is compiled as an Apache module. You can achieve the same effect using the Status header.

<?php
header
( "Status: 404 Not Found" );
?>

The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless some 3xx status code has already been set.

<?php
header
( "Location: http://www.example.com/" ); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>

Замечание: HTTP/1.1 requires an absolute URI as argument to Location: including the scheme, hostname and absolute path, but some clients accept relative URIs. You can usually use $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'] and dirname() to make an absolute URI from a relative one yourself:

<?php
header
( "Location: http://" . $_SERVER [ 'HTTP_HOST' ]
                      .
dirname ( $_SERVER [ 'PHP_SELF' ])
                      .
"/" . $relative_url );
?>

PHP scripts often generate dynamic content that must not be cached by the client browser or any proxy caches between the server and the client browser. Many proxies and clients can be forced to disable caching with:

<?php
// Date in the past
header ( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );

// always modified
header ( "Last-Modified: " . gmdate ( "D, d M Y H:i:s" ) . " GMT" );

// HTTP/1.1
header ( "Cache-Control: no-store, no-cache, must-revalidate" );
header ( "Cache-Control: post-check=0, pre-check=0" , false );

// HTTP/1.0
header ( "Pragma: no-cache" );
?>

Замечание: You may find that your pages aren't cached even if you don't output all of the headers above. There are a number of options that users may be able to set for their browser that change its default caching behavior. By sending the headers above, you should override any settings that may otherwise cause the output of your script to be cached.

Additionally, session_cache_limiter() and the session.cache_limiter configuration setting can be used to automatically generate the correct caching-related headers when sessions are being used.

Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.

<html>
<?php
/* This will give an error. Note the output
* above, which is before the header() call */
header ( 'Location: http://www.example.com/' );
?>

Замечание: As of PHP 4, you can use output buffering to get around this problem, with the overhead of all of your output to the browser being buffered in the server until you send it. You can do this by calling ob_start() and ob_end_flush() in your script, or setting the output_buffering configuration directive on in your php.ini or server configuration files.

If you want the user to be prompted to save the data you are sending, such as a generated PDF file, you can use the Content-Disposition header to supply a recommended filename and force the browser to display the save dialog.

<?php
// We'll be outputting a PDF
header ( 'Content-type: application/pdf' );

// It will be called downloaded.pdf
header ( 'Content-Disposition: attachment; filename="downloaded.pdf"' );

// The PDF source is in original.pdf
readfile ( 'original.pdf' );
?>

Замечание: There is a bug in Microsoft Internet Explorer 4.01 that prevents this from working. There is no workaround. There is also a bug in Microsoft Internet Explorer 5.5 that interferes with this, which can be resolved by upgrading to Service Pack 2 or later.

Замечание: If safe mode is enabled the uid of the script is added to the realm part of the WWW-Authenticate header if you set this header (used for HTTP Authentication).

Смотрите также headers_sent(), setcookie(), and the section on HTTP authentication.

Все функции PHP:
Авторизация
Логин

Пароль



Вы не зарегистрированы?
Нажмите здесь для регистрации.

Забыли пароль?
Запросите новый здесь.
Мини-чат
Вы должны авторизироваться, чтобы добавить сообщение.

04/02/2012 09:08
Еще раз прошу всех. Если вопрос не личный, пишите в форум. В личке, аське, скайпе, мейле и т.д. не консультирую




14/01/2012 18:45
avisei, пиши в форум, а не шли мне личные посланья

31/12/2011 16:01
С праздником Нового Года! Успехов, счастья, богатства!


08/12/2011 16:13
MySQL нужен. Инструкция вот: [url]http://ap-fus
ion.ru/downloads.p
hp?download_id=58[
/url]

08/12/2011 16:03
Я канеш дико извиняюсь, но где на этом сайте статья по установке fusion, нужен ему MySql или нет? Smile


07/12/2011 11:03
ОК)

07/12/2011 11:02
этот - для 7.0

07/12/2011 11:00
Я устанавливаю, как в инструкции. Куча ошибок. Не могу сделать upgrade!

07/12/2011 10:56
Для какой стандартной подходит, для такой же и ap-fusion подойдет


07/12/2011 10:54
Для какой версии AP-FUSION подходит "extended-do
wnloads
"? Shock

24/10/2011 20:48
Валиор, я не поленился и проверил еще раз - в трех файлах этот фрагмент есть, в одном из них - дважды. Так что я не ошибся, это Вы так искали.

24/10/2011 16:06
Ну Вам удалось, значит в принципе возможно. А вообще не рекомендую, но если очень хочется, придется смириться с некоторыми неудобствами. На этом сайте поддержка реализована частично.







24/10/2011 16:05
Возможно ли регистрировать кирилические ники? В письме с регистрацией не указан логин.


Билеты в Кремлевский дворец - билеты в концертный зал кремлевский дворец. Концертные Залы.
21/10/2011 17:03
Занимаюсь. Локаль в порядок привожу. Сегодня или завтра что-нибудь выложу.



20/10/2011 16:09
да бог с ним, ты лучше пимпедом займись, а я не буду в этой сборке использовать основной каталог.



18/10/2011 21:54
Papich, плагин проверю обязательно, мб неисправленный в сборку поставил


22/09/2011 20:47
http://tools.dynam
icdrive.com/favico
n/ - фавиконка быстро и удобно

12/08/2011 21:09
Потому что не осознали еще всего того удобства, что он предоставляет.


10/08/2011 10:20
Почему никого не интересует мой новый чат?

13/06/2011 12:13
Самому не нравится. Пробовал по всякому. Вдобавок ещё и таблицу обрезает, остаётся процентов 40. http://www.cqham.s
umy.ua/viewpage.ph
p?page_id=44 - вариант вставки таблицы




Анонс
Последние статьи
· СМС и Вебмани
· TinyMCE для пользова...
· PCRE (Perl Compatibl...
· PCRE (Perl Compatibl...
· 510
4,241,994 уникальных посетителей Iceberg by Harly