home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / free_security / languard / languardnss7.exe / php_version.vbs29 < prev    next >
Encoding:
Text File  |  2004-10-12  |  961 b   |  48 lines

  1. 'check if php version
  2. 'not older than 4.3.8
  3.  
  4. Function Main 
  5.     Dim i As Integer
  6.     Dim objHTTP As Object 
  7.     Dim varHTTPResponse As Variant 
  8.     Dim objRegexp As Object
  9.     Dim bResult As Boolean
  10.     Dim objHeaders As Object
  11.     
  12.     
  13.     ip = getparameter("ComputerIP")
  14.     port = 80 
  15.         
  16.     bResult = false
  17.         
  18.     cr = Chr(13) + Chr(10)    
  19.  
  20.     Set objRegexp = CreateObject("Vbscript.regexp")
  21.     objRegexp.ignorecase = true
  22.  
  23.     Set objHTTP = HTTP.Connect (ip,port) 
  24.  
  25.     objHTTP.GetURL ("/") 
  26.     objHTTP.Authentication = 1 
  27.  
  28.     objHTTP.verb = "HEAD" 
  29.     ' Send the HEAD request 
  30.     varHTTPResponse = objHTTP.SendRequest () 
  31.  
  32.     Set objHeaders = objHTTP.ResponseHeaders 
  33.     
  34.     objRegexp.pattern = ".*PHP/4\.3\.[0-7][^0-9]"
  35.     If objRegexp.test (objHeaders.HeaderValue("Server")) Then              
  36.         bResult = true
  37.     Else
  38.         objRegexp.pattern = ".*PHP/([0-3]\.|4\.[0-2]\.|4\.3\.[0-7][^0-9])"
  39.         If objRegexp.test (objHeaders.HeaderValue("X-Powered-By")) Then              
  40.             bResult = true
  41.         End If    
  42.     End If    
  43.  
  44.  
  45.     main=bResult
  46.  
  47. End Function 
  48.