Having completed #8, I have some questions about SSI

A place where newbies can post without (much) fear of reprisal. All mission posts should still go in the applicable forum.
Forum rules
Older HTS users: Be nice to the new people.

NEW USERS: This is NOT the place to post about missions! Refer to "Missions" category.

Having completed #8, I have some questions about SSI

Post by ThumbzArt on Sat Jun 21, 2014 1:41 pm
([msg=81574]see Having completed #8, I have some questions about SSI[/msg])

Firstly, I tried posting it Missions, and could not create a new post. Also, this post seemed too specific to be put there with the mission itself, though I'm still unsure where the line is drawn.

I don't want to be too specific, so let me know if I'm overstepping my bounds or should be talking about this in private chat. Basically, I did this one by googling "SSI" and inputing what it gave me as example text, but I couldn't find why it works. Specifically, I don't understand why a comment tag would do anything at all, especially when something like a bold tag
Code: Select all
<b>test</b>
is just parsed into
Code: Select all
&lt;b&gt;test&lt;/b&gt;


Further, what does this most likely look like server side?
ThumbzArt
New User
New User
 
Posts: 2
Joined: Sat Jun 21, 2014 1:33 pm
Blog: View Blog (0)


Re: Having completed #8, I have some questions about SSI

Post by cyberdrain on Sat Jun 21, 2014 6:42 pm
([msg=81581]see Re: Having completed #8, I have some questions about SSI[/msg])

OK, so you know HTML is a mark-up language, right? That means every directive in the HTML file will be checked and used according to the standard to be displayed. Normally only the HTML file is served, but in case of server side includes, the server recognizes that a certain tag is included in the file and that the file is either executable or of the SSI-type. Next the SSI interpreter reads the files, uses the directives given to execute/evaluate the given commands and includes the results in the HTML file sent to the user instead of the directive.

The reason SSI is used in comments is a simple one: in case something goes wrong and interpretation fails, the resulting HTML file will not display the commands, but only in the normally non-visible comments of the file. Another language to use this method of concealing commands is CSS for conditional statements.

Difference between server side and client side, on the server the HTML file can include the directive
<!--#echo var="DATE_LOCAL" --> in the source code, but when served to the user one would only see the local date of the server instead of the include (if all goes well).
Free your mind / Think clearly
I use the sarcasm color for both sarcasm and irony
User avatar
cyberdrain
Addict
Addict
 
Posts: 1501
Joined: Sun Nov 27, 2011 1:58 pm
Blog: View Blog (0)


Re: Having completed #8, I have some questions about SSI

Post by ThumbzArt on Sun Jun 22, 2014 6:34 pm
([msg=81615]see Re: Having completed #8, I have some questions about SSI[/msg])

alright. that makes a bit more sense. I still find it odd that they use comment tags, but I guess that would be the easiest way to implement without having to change any of the rules of html.

one last question, what is likely the functional code on server side? Any clue what the likely function is for this variable to be passed to?
ThumbzArt
New User
New User
 
Posts: 2
Joined: Sat Jun 21, 2014 1:33 pm
Blog: View Blog (0)


Re: Having completed #8, I have some questions about SSI

Post by cyberdrain on Mon Jun 23, 2014 4:52 pm
([msg=81634]see Re: Having completed #8, I have some questions about SSI[/msg])

Read an example for the source code of an SSI interpreter here. In the case for DATE_LOCAL specifically, it uses the CGI environment variables.
Free your mind / Think clearly
I use the sarcasm color for both sarcasm and irony
User avatar
cyberdrain
Addict
Addict
 
Posts: 1501
Joined: Sun Nov 27, 2011 1:58 pm
Blog: View Blog (0)



Return to NZone

Who is online

Users browsing this forum: No registered users and 0 guests