Free HTML code reduction (.asp)
The basic idea of this script is to remove useless information from your HTML pages, so that they may be transfer to your client faster (and you will also contribute to reduce wasting a bit of energy). 

This 1.0 version will only remove redundant spaces. Very often, HTML editors will include in the HTML code a huge number of useless spaces (sometimes up to 25% of file´s size). This script will remove them. 
 

code-reduction.asp
<HTML><HEAD><TITLE>Code reduction</TITLE></HEAD><BODY BGCOLOR=FFFFFF>
 

<%
if request.form("username")="myusername" AND request.form("password")="mypassword" then
FolderName = request.form("FolderName")
response.write ("<BR><b>Code Reduction: pages which has been reduced</b><BR>")
FolderToCheck = "e:\mydir1\mydir2\" & FolderName & "\"
 Dim fs, f, f1, fc, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFolder(FolderToCheck)
 Set fc = f.Files
 For Each f1 in fc

         Wfile = f1.name
          if right(Wfile, 4)=".htm" OR right(Wfile, 5)=".html" then
            Wfile2 = FolderToCheck & Wfile
            Set fs = CreateObject("Scripting.FileSystemObject")
            Set a = fs.OpenTextFile(Wfile2)
            ct = a.ReadAll
            bytesct=len(ct)
            a.close
            Do While instr(ct,"  ")>0
            ct=replace(ct,"  "," ")
            Loop
            bytesct2=len(ct)
            Set a = fs.CreateTextFile(Wfile2,TRUE)
            a.write(ct)
            a.close
            response.write (Wfile2 & ":  &nbsp;" & bytesct2  & " bytes (" & bytesct & " before code reduction)<BR>")
          end if

Next

else
%>
<CENTER>
<Form Action=codereduction.asp method=post>
<TABLE BORDER=0 BGCOLOR=AAAAFF><TR><TD>
<TABLE BORDER=0>
<TR><TD>FolderName: </TD><TD><input type=text name=FolderName size=30><BR><font size=1>"directory"  or "dyrectory1\directory".</font> </TD></TR>
<TR><TD>Username:  </TD><TD><input type=text name=username size=30></TD></TR>
<TR><TD>Password:  </TD><TD><input type=text name=password size=30></TD></TR>
</TABLE>
</TD></TR></TABLE>
<input type=Submit Value=Send>
</form>
<BR>
Free script provide  by <A href=http://www.codedcode.com>codedcode.com</a>
</CENTER>

<% end if  %>

</BODY></HTML>

For security porpouses, this scrips will ask you for a username ("myusername") and password ("mypassword"), so you will need to introduce your username and password to use this scripts. In order to customized this script you will need to introduce the path to your main directory ("e:\mydir1\mydir2\"). 

When running this script, it will be request to you the username, password and the directory in which you want to reduce the code of your ".htm" and ".html" pages. Those data will be request with a form like the one bellow (this one is not functional).










   



MSN Nick Name



More Resources...





Most Viewed Services:
  1. HTML Tutorial
  2. XHTML Tutorial
  3. CSS Tutorial
  4. Javascript Tutorial
  5. DHTML Tutorial
  6. VB Script
  7. TCP/IP Tutorial
  8. ADO Tutorial
  9. MYSQL Tutorial
  10. ASP Tutorial
  11. AJAX Tutorial
  12. CFML Tutorial
  13. PHP Tutorial
  14. WML Tutorial
  15. FLASH Tutorial
  16. XML Tutorial
  17. RSS Tutorial
  18. SQL Tutorial
  19. HTML Articles
  1. Javascript Articles
  2. PHP Articles
  3. SEO Articles
  4. Web Design Articles
  5. SEO Tips
  6. Web Design Tips
  7. Articles
  8. CSS
  9. CSS Tips
  10. HTML Tips
  11. JAVASCRIPT Tips
  12. MYSQL Tips
  13. PHP Tips
  14. Money
  15. Tutorials
  16. Web Hosting



  • Home
  • Web Directory
  • Top Directoriers
  • Webmaster Directories
  • Contact
  • © Copyright 2006-2010 All Rights Reserved By CodeDcode.Com : HTML : RSS : TEXT : XML