PHP - ayuda!!!!!Urgente??????

 
Vista:

ayuda!!!!!Urgente??????

Publicado por Alex (4 intervenciones) el 04/04/2005 18:21:19
holas no cacho una de PHP, y necesito hacer lo siguiente en PHP.
Esto registra la Ip de una maquina y luego crea una archivo asp donde guarda dicha ip.
esto lo hace en asp, pero como lo hago en PHP???????

<%
response.Expires=0
Dim objFSO,f,Archivo,xurl,xNewUrl
if Request("Puerto")<>"" then
xurl="http://" & Request.ServerVariables("REMOTE_ADDR") & ":" & Request("Puerto")
else
xurl="http://" & Request.ServerVariables("REMOTE_ADDR")
end if
xPath=Request.ServerVariables("PATH_TRANSLATED")
xPath=left(xPath,instrrev(xPath,"\")) & Request("ID") & ".asp"
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set f = objFSO.CreateTextFile(xPath)
f.WriteLine("<" & "%Response.redirect " & chr(34) & xurl & chr(34) & "%" & ">")
f.close
Set objFSO=nothing
xNewUrl=Request.ServerVariables("PATH_INFO")
xNewUrl=left(xNewUrl,instrrev(xNewUrl,"/"))
xNewUrl= xNewUrl & Request("ID") & ".asp"
Response.Write ("<h2>Su url:" & xurl & "<br> ha sido redireccionada a : <a href='" & xNewUrl & "'>" & xNewUrl& "</a></h2>")
%>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:ayuda!!!!!Urgente??????

Publicado por Mike79 (669 intervenciones) el 05/04/2005 00:59:44
Con esto obitenes el ip:

$Ip = getenv("REMOTE_ADDR");
Lo unico que resta es guardarlo en un archivo.

Saludos!
-
Miguel Angel
Mike79
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ayuda!!!!!Urgente??????

Publicado por Alex (4 intervenciones) el 05/04/2005 05:11:27
pero como se comporta esto en PHP para crear un archivo.???????

xPath=Request.ServerVariables("PATH_TRANSLATED")
xPath=left(xPath,instrrev(xPath,"\")) & Request("ID") & ".asp"
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set f = objFSO.CreateTextFile(xPath)

aca estoy botadoooooo........
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ayuda!!!!!Urgente??????

Publicado por Mike79 (669 intervenciones) el 05/04/2005 22:08:05
¿¿Y si lees??

http://www.php.net/manual/en/function.fopen.php

Abres el archivo en esritura y grabas información ahi.
Saludos!
-
Miguel Angel
Mike79
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar