sqlpage.header(name)
Introduced in SQLPage 0.7.2.
Reads a header with the given name from the request. Returns the value of the header as text, or NULL if the header is not present.
Example
Log the User-Agent
of the browser making the request in the database:
INSERT INTO user_agent_log (user_agent) VALUES (sqlpage.header('user-agent'));
If you need access to all headers at once, use sqlpage.headers()
instead.
Parameters
name
The name of the HTTP header to read.
basic_auth_password
basic_auth_username
client_ip
cookie
current_working_directory
environment_variable
exec
fetch
fetch_with_meta
hash_password
header
headers
link
path
persist_uploaded_file
protocol
random_string
read_file_as_data_url
read_file_as_text
request_body
request_body_base64
request_method
run_sql
uploaded_file_mime_type
uploaded_file_name
uploaded_file_path
url_encode
variables
version