How to direct a browser to display a different HTML page This is actually very simple to do in a CGI script. Instead of the usual header
How to manipulate browser caching
Using an Expires header is the best way of achieving this in most cases. Specify a date in the past, and the browser will think the page must be updated next time it requires it.
You can also specify to certain browsers that they should not cache this document by returning a no-cache pragma.
The pragma is returned as part of your header. For example, your script might return
Some of the more useful environment variables can be fetched through this interface. The methods are as follows:
Return a list of MIME types that the remote browser accepts. If you give this method a single argument corresponding to a MIME type, as in $query->accept('text/html'), it will return a floating point value corresponding to the browser's preference for this type from 0.0 (don't want) to 1.0. Glob types (e.g. text/*) in the browser's accept list are handled correctly.
Returns the HTTP_COOKIE variable, an HTTP extension implemented by Netscape browsers version 1.1 and higher. Cookies have a special format, and this method call just returns the raw form (?cookie dough). See cookie() for ways of setting and retrieving cooked cookies.
Returns the HTTP_USER_AGENT variable. If you give this method a single argument, it will attempt to pattern match on it, allowing you to do something like $query->user_agent(netscape);
Returns additional path information from the script URL. E.G. fetching /cgi-bin/your_script/additional/stuff will result in $query->path_info() returning "additional/stuff".
As per path_info() but returns the additional path information translated into a physical path, e.g. ``/usr/local/etc/httpd/htdocs/additional/stuff''.
Returns either the remote host name or IP address. if the former is unavailable.
Return the script name as a partial URL, for self-refering scripts.
Return the URL of the page the browser was viewing prior to fetching your script. Not available for all browsers.
Return the authorization/verification method in use for this script, if any.
Returns the name of the server, usually the machine's host name.
When using virtual hosts, returns the name of the host that the browser attempted to contact.
Returns the server software and version number.
Return the authorization/verification name used for user verification, if this script is protected.
Attempt to obtain the remote user's name, using a variety of different techniques. This only works with older browsers such as Mosaic. Netscape does not reliably report the user name!
Returns the method used to access your script, usually one of 'POST', 'GET' or 'HEAD'.
Creating a self-referencing URL which preserves state information:
|All times are GMT +5.5. The time now is 11:25.|