Apache also supports XSSI (eXtended Server Side Includes), which provides more advanced command functions (and, consequently, uses code that is a bit more complicated for non-programmer types).
Flow Control Elements
Flow control elements are a set of if/else commands (similar to if statements used in a programming language) that allow authors to create conditional commands. Using flow control elements, authors can make documents display differently based on specific variables (the "test conditions"). For instance, you could publish one version of your page for users accessing it with the Navigator browser and another for Internet Explorer users. The basic flow elements are:
The first command contains the if statement that causes the server to test for a condition (e.g., if the browser is Navigator). If it is found to be true, the server prints the text or executes any SSI commands immediately following the if command. If the test condition posed by the if statement is false, the elif statement (which stands for "else if") is tried next. If the elif test condition is true, the server prints or executes whatever follows it.
Otherwise, the server prints orexecutes whatever comes after else, which acts as a catch-all for every other condition that might exist. An if/else statement like this can have as many elifs as you want to add, each of which is tested in turn, and it does not require that you have an else statement at the end -- in which case, if none of the if or elif statements are found to be true, the server does not do anything.
The endif element ends the if element and is required. In the following example, a greeting is customized based on the user's browser:<!--#if expr=""$HTTP_USER_AGENT" = "Mozilla"" --> Welcome Netscape User!<!--#elif expr=""$HTTP_USER_AGENT" = "Explorer"" --> Welcome Internet Explorer User!<!--#else --> Welcome!<!--#endif -->
As you can see, this is where a little programming knowledge comes in handy for getting the most out of SSI.
The standard available environment variables were introduced earlier in this chapter. XSSI adds the capability to create your own variables using the set element as follows:
Your customized variables can then be used as test conditions using the flow control elements listed earlier.
Web Designing Related Interview Questions
|HTML Interview Questions||HTML 5 Interview Questions|
|Flash Interview Questions||Graphic Design Interview Questions|
|Illustrator Interview Questions||Dreamweaver Interview Questions|
|UI Developer Interview Questions||Dreamweaver CS3 Interview Questions|
|CSS Advanced Interview Questions||Web Developer Guide Interview Questions|
|Log Shipping Interview Questions||Spring Boot Interview Questions|
|UI Designer Interview Questions||Bootstrap 4 Interview Questions|
Web Designing Related Practice Tests
|HTML Practice Tests||HTML 5 Practice Tests|
|Flash Practice Tests||Graphic Design Practice Tests|
|Illustrator Practice Tests||Dreamweaver Practice Tests|
|UI Developer Practice Tests||Dreamweaver CS3 Practice Tests|
|Web Developer Guide Practice Tests||Advanced jQuery Practice Tests|
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.