PHP help required!

PHP help required!

av Jason Vickers -
Galle vástádusa: 6

This probably is not the best way, however since I don't know much PHP and have had countless problems with the LDAP module I am attempting it....

This is the code I have in ASP

    Dim Group
    Dim User

  Logonname = Trim(Replace(UCase(Request.ServerVariables("LOGON_USER")),"JRS\",""))

  Sub PullUserFullname(strDomain,strUser)
    Dim User
    Set User = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
    Response.write "<BR>" &  User.Fullname
  End sub

  Sub PullUserHomeDirPath(strDomain,strUser)
    Dim User
    Set User = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
    Response.write "<BR>" &  User.HomeDirectory
  End Sub

  PullUserHomeDirPath "JRS",Logonname
  PullUserFullName "JRS",Logonname

What I would like to do is this but in PHP... any pointers guys?

Gjennomsnittlig vurdering: -
Vástádussan geasa: Jason Vickers

Re: PHP help required!

av Nicolas Martignoni -
Bilde av Core developers Bilde av Documentation writers Bilde av Particularly helpful Moodlers Bilde av Plugin developers Bilde av Testers Bilde av Translators
Vástádussan geasa: Nicolas Martignoni

Re: PHP help required!

av Joseph Rézeau -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Plugin developers Bilde av Testers Bilde av Translators
Nicolas,
Do you know of a similar program for converting from Javascript to PHP?
Joseph
Vástádussan geasa: Joseph Rézeau

Re: PHP help required!

av Samuli Karevaara -
That is quite difficult to do, even for humans, as Javascript works on the client side and PHP on the server side. Even Java to PHP is more difficult than ASP to PHP...
Vástádussan geasa: Samuli Karevaara

Re: PHP help required!

av Joseph Rézeau -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Plugin developers Bilde av Testers Bilde av Translators

Thanks, Nicolas and Samuli.

I recently had to re-write a certain routine from Javascript to PHP. This was mainly character string manipulation, nothing fancy, nothing that would entail client side versus server side functionality (I think).

I could not find a program which would (semi-)automatically rewrite my Javascript to PHP (and I do not think it exists).

At least I was glad to find the nearest thing to that, a list of Javascript functions with their PHP equivalents, here. (Sorry about the distasteful Paris Hilton pic. theresad).

Maybe that can help others,

Joseph