Guide Categories:  Home | Drivers | Web Development | Hardware | Internet | Q & A | Tips & Tricks | Write
Web Development Silicon Guide
Search SiliconGuide:

Site Services:
Log In
Sign Up

Guides:
Getting Sponsored
Using SSI

#!/usr/bin/perl print < end

#!/usr/bin/perl $random = int(rand(10)); #$random = 10; if ($ENV{'REQUEST_URI'} eq "/qa/forum/messages/259.shtml") { print <
Older printer drivers are always hard to find. How about the ink cartridges for them? Dell ink is the hardest to find. Printer ink for the older machines can be easy to find if you know right where to look. Shop around to find the best deals on inkjet and toner cartridges.
end } elsif ($ENV{'REQUEST_URI'} eq "/tips/win95/office/office.shtml") { print <
Need a place for your Internet mail? Then Exchange email outsourcing is the way to go! No hassles, no coding experience, very little microsoft exchange server experience required at all.
end } elsif ($ENV{'REQUEST_URI'} eq "/internet/napster/4.shtml") { print <
Looking for mp3 players? Need a place to share your music. If you compare prices on some of the top MP3 players, you will notice that they are very inexpensive. Price comparison can be very beneficial to you.
end } elsif ($ENV{'REQUEST_URI'} eq "/qa/forum/messages/975.shtml") { print <
When designing pets in Sims, you may remember that you need pet supplies for your real pet. As much as its just a game, your real pet needs some lovin' right now. Go buy them a Pet Bed, and or teach your Dog some tricks.
end } elsif ($random eq -1) { print < end } elsif ($random eq -2) { @siliconmail_banners=("mail1.gif","mail2.gif","mail3.gif","mail4.gif","mail5.gif"); $ran2 = int(rand(5)); print < Silicon Mail end } elsif (($random >= 0) && ($random <= 7)) { print < end } elsif (($random > 7) && ($random <= 8)) { print < end } else { print < end } #print < #
# #end

The Silicon Guide To
Using Server Side Includes

The Echo Command

The echo command is used to display information about the current state of affairs on your server. 

The syntax to use any echo command is:
<!--#echo var="COMMANDGOESHERE"-->

For example to display the current date I would insert the followind into my HTML code:
<!--#echo var="DATE_LOCAL"-->,
since DATE_LOCAL is the command used to display the current local date.  The result is:
Thursday, 25-Apr-2024 12:16:31 UTC

Here is a list of all the echo commands at your disposal, along with a description of what they do, and a real-time example:

Command Description Real time Example
AUTH_TYPE The type of authorisation used by the browser. (none)
CONTENT_LENGTH The length of the input sent to the server. (none)
CONTENT_TYPE The kind of content being sent (usually html). (none)
DATE_GMT Current Greenwich Mean Time Thursday, 25-Apr-2024 12:16:31 GMT
DATE_LOCAL Current Local Time Thursday, 25-Apr-2024 12:16:31 UTC
DOCUMENT_NAME Name of current document 2.shtml
DOCUMENT_URL The address of the current document. (none)
LAST_MODIFIED The date at which the current document was last modified. Tuesday, 15-Oct-2002 16:43:58 UTC
PAGE_COUNT The number of hits this page has received. (none)
HTTP_REFERER Where the person viewing the page came from. (none)
REMOTE_ADDR IP Address of the person viewing the current document. 3.21.233.41
REMOTE_HOST Domain Name of the person viewing the current document. (none)
REMOTE_USER User name of current client. (if you see this displayed in the example, your ISP has a security hole, as this should never be known). (none)
REQUEST_METHOD The method by which the document was accessed (GET or the more safe POST) GET
SERVER_NAME The name of the server hosting the document. www.siliconguide.com
SERVER_PORT The port that serve's html documents on the current server.  (ex: 80 for html, 21 for ftp, etc...) 80
SERVER_PROTOCOL HTML Protocol used by server. HTTP/1.1
SERVER_SOFTWARE Software used by the server to serve html documents (Apache is the most popular, although Microsoft Back Office and Netscape Enterprise Server, as well as many others also exist) Apache/2.4.54 (Debian)
TOTAL_HITS Number of hits the server has gotten since it was set up. (none)

Next Page:
The Config Command
Skip Ahead:
Including files
Executing CGI Scripts
SSI Hosting and Conclusion

Home | Web Development | Hardware and Upgrading | Internet | Technical Questions & Answers | Tips and Tricks | Write to Us

Last modified on: Tuesday, October 15 2002 at 04:43 PM - UTC
Copyright © 1999 - 2012 SiliconPharm Corporation, All Rights Reserved
Powered by Apache/2.4.54 (Debian) (More Info)