Perl Cd Bookshelf [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Cd Bookshelf [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



21.5. Interrogating Headers


21.5.1. Problem


You want to learn
the value of a header sent by the client.

21.5.2. Solution


Use the $r->header_in method:

$value = $r->header_in("Header-name");

21.5.3. Discussion


For example, suppose you want to discover the client's preferred
language (as sent in the Accept-Language header).

if ($r->header_in("Accept-Language") !~ /\ben-US\b/i) {
$r->print("No furriners!");
return OK;
}

If you want to access more than one header, use the
$r->headers_in method, which returns a list of
key-value pairs of all clients' request headers, which are typically
assigned to a hash:

%h = $r->headers_in;
if ($h{"Accept-Language"} !~ /\ben-US\b/i) {
$r->print("No furriners!");
return OK;
}

21.5.4. See Also


Writing Apache Modules with Perl and C; Recipe
3.4 in mod_perl Developer's Cookbook; the
Apache.pm manpage



21.4. Redirecting the Browser21.6. Accessing Form Parameters




Copyright © 2003 O'Reilly & Associates. All rights reserved.

/ 875