|
|
bonjour,
j'ai un script écrit en ASP , est ce que quelqu'un pourrait le transformer en PHP ou autre format qui marche sur FTP.
je vous remercie d'avance pour vos réponse
voila le script:
<%
If IsEmpty(Session("TotalCount")) Then
Call CountThisUser
End If
Sub CountThisUser()
Dim objFSO ' FileSystemObject
Dim objTS ' TextStreamObject
Dim strFileName ' Counter text File Name
Dim intOldCount
Dim intNewCount
' Specify the Text file to store count value
' Because We Set Create = True
' File will be Created if it does not exist
strFileName = Server.MapPath("Counter.txt")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strFileName) Then
Set objTS = objFSO.OpenTextFile(strFileName, 1)
Else
Set objTS = objFSO.CreateTextFile(strFileName, True)
End If
If Not objTS.AtEndOfStream Then
intoldCount = objTS.ReadAll
Else
intoldCount = 30
End If
objTS.Close
intNewCount = intOldCount - 1
If (intNewCount)=0 Then
Session("TotalCount")=0
intNewCount=30
Else
' Store the value of intNewCount in Session Variable
' So you can use it on different pages
Session("TotalCount")= intNewCount
End If
' Write intNewCount value back to text file
Set objTS = objFSO.CreateTextFile(strFileName, True)
objTS.Write intNewCount
objTS.Close
Set objFSO = Nothing
Set objTS = Nothing
End Sub
%>
|