PHP
PHP Programming
What are the useful fields of $_SERVER array in PHP
Jan 12th
The following table describes useful fields in $_SERVER array in PHP.
Name Description PHP_SELF Returns the filename of the current script SERVER_PROTOCOL Name and revision of the information protocol ‘HTTP/1.0‘ or ‘HTTP/1.1′ REQUEST_METHOD Returns the request method used to access (GET/POST/PUT) REQUEST_TIME Returns the timestamp from the beginning DOCUMENT_ROOT Returns the root directory under which the current script is executing. This directory is based on server’s configuration. HTTP_REFERER Returns the page address that referred HTTP_USER_AGENT Returns the contents of user agent extracted from HTTP header. This information is typically used for identification of user’s browser and operating system. REMOTE_ADDR Returns the More >PHP Page Redirection
Jul 27th
This article explains how to redirect to another page using PHP. You can use header function in the beginning of PHP script to inform browser about page redirection. Basically this writes Hyper Text Transfer Protocol(HTTP) header with the field Location. You should not write any text before writing HTTP header. However you can have some text after writing header and it will appear in the browser while browser attempts to access the new page. Generally you won’t notice the message unless your internet connection is slow and browser is taking more time to retrieve new file.
<?php
header('Location: http://mysite.com/newpage.html');
?>
More >


Recent Comments