SSI Raiders - What is the website SHTML file?

xiaoxiao2021-03-06  59

SSI (Server Side Include), is often referred to as server-side embedding, is a server-based web-based web-based technology similar to ASP. Most of the WEB servers based on UNIX platforms, such as Netscape Enterprise Server, supports SSI commands.

SSI work principle:

In a SSI file that is usually .SHTML, the standard HTML encoding will be sent directly to the browser, and the SSI command in the embedded Perl language is first explained by the web server, if it is the standard output, The output information will also be sent to the browser as a standard HTML.

SSI simple application example:

my first ssi page </ title> </ head> <body> Welcome (at <! ->) to access this website. </ Html> The "<! - # ->" structure in the above document indicates that the SSI command will be executed by the server, not directly to the client. We can use the "View → Source File" in the browser:</p> <p><Html> <head> <title> my first ssi page </ title> </ head> <body> Welcomes you (DEC 06 1999) to visit this website. </ Html></p> <p>We found that HTML in the document is directly transmitted to the client, and the SSI command is executed. The SSI code is invisible at the client, and the client can only see the effect it performs.</p> <p>A more practical example</p> <p>One problem that the website maintenance often encounters is that the structure of the website has been fixed, but it has to be a large number of web pages in order to update some content. SSI provides a simple and effective way to solve this problem. It places the basic structure of a website in several simple HTML files (templates), which will only pass text to the server in the future, let the program Automatically generate a web page according to the template to make the management large site easier. Such as:</p> <p><Html> <head> <title> ssi example </ title> </ head> <body> <h2> News </ h2> <p> <! - # include file = "news.txt" -> < P> News update Date: <! - # FlastMod file = "news.txt" -> </ body> </ html></p> <p>Place frequent updates in News.txt, SSI will contain its contents into the output web page via the include instruction. The latest change date of New.txt can be displayed in the web page via the FLASTMOD instruction.</p> <p>Construct the environment of learning SSI</p> <p>Support for SSI's Web Server, such as Omnihttpd Professional, this is a web server that supports SSI's WIN 95/98 platform. You can download this shared software directly from http://www.omnicron.ab.ca/httpd/. # Echo</p> <p>Role: Insert environment variables into the page. Syntax: <! - # echo var = "Variable Name" -> Example: This document name: <! - # echo var = "document_name" -> Today: <! - # echo var = "Date_local "-> Your IP address is: <! - # echo var =" remote_addr "-> Variables used in SSI: 1. Only variables that can be used in SSI. 2. Standard CGI variable 3. Some servers supported variables 1 below is the variables supported by standard SSI: Variable Name Scheme 1 Document_name Current Document Name Echo.html 2 Document_URL or Document_uri Current Document Relative to URL /ssi/echo.html 3 Query_String_unescape or query_string sent by query String Sample 4 Date_local Server Current Date Sun, 23 May 1999 21:54:30 5 Date_GMT Server Time Set by Greenwich Time Sun, 23 May 1999 13:54:30 6 Last_Modified current document last modified time 23-May -1999 PST 2 Standard CGI Variable Web About CGI Environment Variable Test: Linux Under Apache: http: //hoyi.zb169.net/cgi-bin/hiecho.ci? SampleFreebsd Under Apache: http: // hoyi. OnlineExpress.net/cgi-bin/hiecho.ci?sample CGI Environment Variable Name Scheme 1 Authentication Type 2 Content_Type User 2 Content_Length Server Output Text Length 0 3 HTTP_ACCEPT Client Acceptable MIME Type Application / VND.MS- Excel, Application / MSWORD, * / * 4 http_user_agent client browser configuration status mozilla / 4.0 (compatible; msie 4.01; windows 98) 5 GateWary_Interface server CGI / 1.1 6 Path_info client gives additional Path Information 7 Path_Translated Path_info value, but with virtual path / v / spool / webadm / html 8 query_string with an extension to a directory specification, in the URL that references this script, follow the question mark (?) Sample 9 Remote_Addr Customer Machine IP address 202.103.27.103 10 Remote_host client name 11 Request_method HTTP request method GET 12 script_na Me Current Script Name / CGI-MAIN/CGIWRAP/HOYI/HIECHO.CGI 13 Server_name server name or IP address hoyi.zb169.net 14 Server_Port server connection TCP / IP port 80 15 Server_Protocol and request information Retrieval agreement name With versions, usually http / 1.0 http / 1.1 16 Server_software response requests Web server software name and version apache / 1.3.6 (unix) 2, # include: Plug the content of text files directly into the document page.</p> <p>Syntax: <! - # = "file name" -> <! - # clude virtual = "file name" -> file file name is a relative path, the path relative to documentation using the #include instruction The directory where you are located. The included files can be in the same level directory or their subdirectories, but cannot be in the previous directory. As indicating the NAV_HEAD.htm document in the current directory, File = "NAV_HEAD.HTM". The Virtual file name is the full path to the virtual directory on the Web site. As indicating the NAV_HEAD.htm file under the HOYI directory relative to the server document; the file = "/ hoyi / nav_head.htm" parameter: file specifies that the location Virtual specified by the file relative to this document is specified relative to the server document root directory. Location Note: 1. The file name must have an extension. 2. The file being included can have any file extensions. I feel that I use the HTM extension directly, Microsoft recommends using the .inc extension (this will look at your hobby). Example: <! - # clude file = "nav_head.htm" -> Plug the header file into the current page <! - # include file = "nav_foot.htm" -> Insert the tail file into the current page 2, #include Role: Insert the content of the text file directly into the document page. Syntax: <! - # = "file name" -> <! - # clude virtual = "file name" -> file file name is a relative path, the path relative to documentation using the #include instruction The directory where you are located. The included files can be in the same level directory or their subdirectories, but cannot be in the previous directory. As indicating the NAV_HEAD.htm document in the current directory, File = "NAV_HEAD.HTM". The Virtual file name is the full path to the virtual directory on the Web site. As indicating the NAV_HEAD.htm file under the HOYI directory relative to the server document; the file = "/ hoyi / nav_head.htm" parameter: file specifies that the location Virtual specified by the file relative to this document is specified relative to the server document root directory. Location Note: 1. The file name must have an extension. 2. The file being included can have any file extensions. I feel that I use the HTM extension directly, Microsoft recommends using the .inc extension (this will look at your hobby). Example: <! - # clude file = "nav_head.htm" -> Insert the header file into the current page <! - # = "nav_foot.htm" -> Insert the tail file into the current page 4. #exec effect: Insert an output of an external program into the page. You can insert the CGI program or the input of the regular application, depending on the parameter used is CMD or CGI. Syntax: Grammar: <! - # EXEC CMD = "File Name" -> <! - # EXEC CGI = "File Name" -> Parameters: CMD General App CGI CGI Script Program: <! - #exec cmd = "CAT / etc / passwd" -> The password file will be displayed <! - # exec cmd = "dir / b" -> will display the current directory list <! - # EXEC CGI = "/ Cgi-bin / gb.cgi" -> will execute the CGI program GB.cgi.</p> <p><! - # exec CGI = "/ cgi-bin / access_log.cgi" -> will execute the CGI program access_log.cgi. Note: From the example above, this instruction is quite convenient, but there is also a security problem. Prohibited method:. Apache deletes the line code of "Options Includes Execcgi" in Access.conf; In IIS, to disable the #exec command, modify the ssiexecdisable metadata; 5. # config: Specifies the format of the error message, date, and file size that returns to the client browser. Syntax: <! - # config errmsg = "Custom Error Information" -> <! - # config sizefmt = "Display Unit" -> <! - # config timefmt = "display format" -> parameter : Errmsg Custom SSI executes error messages, you can do anything you like. Sizefmt file size display mode, the default is byte mode ("Bytes") can be changed to the kilobyte mode ("Abbrev") Timefmt time display mode, the most flexible configuration properties.</p> <p>Code sample action code example effect% a mon Abbreviated week a few% M 05 months% a Monday a few% M 55 vs% b% h AUG abbreviation Month name% P AM, afternoon (AM or PM)% R 10 : 20: 20 AM 12 small time% b Auguest month name% s 40 second% d 01 the third day of the month in the first few days% T 20:20:30 24 small time% d 05/28/99 Digital Date% U% W 21 Weekly per year, per year, the day, no 0% W 2 from Sunday to Today,% h 20 hours (24-hour)% y 99 2 digits format year% i 08 hours (12 hours) System Y999 4-digit Number% J 320 One Number of Day% Z PDT Time Zone Position Code Example Role Code Example M Mon Abbreviation Week Men M 05 Month A MONDAY Week 55% B% h aug abbreviation monthly name% P AM, afternoon (AM or PM)% r 10:20:20 AM 12 small time% b Auguest month name% s 40 second% d 01 the first day % T 20:20:30 24 small time% d 05/28/99 Digital Date% U% W 21 Week to Week in the year E 1 in the first few days, no 0% W 2 from Sunday to today H 20 hours (24-hour)% y 99 2 digit number% i 08 hours (12-hour system)% Y 1999 4-digit representation annual% J 320 day% z PDT time zone position Example: Show a size <! - # config errmsg = "server without file execution error, please contact administrator yiho@126.com, thank you!" -> <! - # fsize file = "does not exist File .htm "-> Display file size <! - # config sizefmt =" abbrev "-> <! - # fsizefile =" news.htm "-> in a specific time format Time <! - # config timefmt = "% y year /% M month% D day week% W Beijing time% h:% m:% s,% y has passed by% J days today is the year % U -> <! - # echo var = "date_local" -> Show Today is a day, a few months, time zone <! - # config timefmt = "Today% a,% b, server time zone Yes % Z, YES "-> <! -> 6.xssi XSSI (Extended SSI) is a set of advanced SSI instructions, built in Apache 1.2 or higher Modular MOD-INCLUDE module in. Among them, the instructions are: #printenv #set #if #printenv effect: Displays all environment variables currently existing in the web server environment. Syntax: <! - # Printenv -> Parameters: Non-Example: <! - # Printenv -> #set effect: You can assign a variable to use for later IF statements. Syntax: <! - # set var = "Variety" value = "Variable value" -> parameter: Non-sample: <! - # set var = "color" value = "red" -> #IF role : Creating a page that can change the data, which is displayed according to the requirements calculated when using the IF statement.</p> <p>Syntax: <! - # i = "$ Variable Name = /" Variable value a / "" -> Display content <! - # Elif expr = "variable name = /" Variable value B / " -> Display content <! - # Else -> Display content <! - # Endif "-> Parameters: About XSSI Condition Expression Expression (String) If String exists, return true string1 = string2 If Two strings are equal, return true string1! = String2 If the two strings do not wait, return true string1 <string2 If string1 is less than String2, return true string1 <= string2 If string1 is less than equal to String2, return true string1> String2 If string1 is greater than String2, return true string1> = String2 If string1 is greater than equal to string2, return to true! String! For "non-" operator; if string exists, return true (string1) && (string2) && is "Operator; string1, string2 exists, return true (string1) !! (string2) !! is" or "operator; string1, string2 has an existence, return true expression (String) If string exists, Return true string1 = string2 If the two strings are equal, return to true string1! = String2 If the two strings do not wait, return true string1 <string2 If string1 is less than String2, return true string1 <= string2 If string1 is less than equivalent String2, return true string1> string2 If string1 is greater than String2, return true string1> = String2 If string1 is greater than equal to string2, return to true! String! For "non-" operator; if string exists, return true (String1) && (String2) && is "with" operators; string1, string2 exists, return true (string1) !! (string2) !! is "or" operator; string1, string2 has an existence, return to true example: < ! - # if expr = "$ server_name = /" hoyi.zb169.net / "-> Welcome to CG I factory in Zibo hotline http://hoyi.zb169.net. <! - # Elif expr = "$ server_name = /" Linux.cqi.com.cn/ "" -> Welcome to CGI factory in Sun City's sub-station http://linux.cqi.com.cn / ~ hoyi. <! - # else -> Welcome to the CGI factory! <! - # endif "-> Note: The backslash used in the front instruction is used to convert the quotation marks inside, so that they will not be interpreted as ending expressions. Not possible</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-117903.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="117903" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.037</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'eKqm3IabZrz7xZ_2F0enlNKPMEGnQIzDFhGVs6RYzPkyM36J2a13z24DLW2ksDZpyKSblx64PwfhvAZDCdqaxOlg_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>