PHP help required!

PHP help required!

Jason Vickers發表於
Number of replies: 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?

評比平均分數: -
In reply to Jason Vickers

Re: PHP help required!

Nicolas Martignoni發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片 Translators的相片
In reply to Nicolas Martignoni

Re: PHP help required!

Joseph Rézeau發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片 Translators的相片
Nicolas,
Do you know of a similar program for converting from Javascript to PHP?
Joseph
In reply to Joseph Rézeau

Re: PHP help required!

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...
In reply to Samuli Karevaara

Re: PHP help required!

Joseph Rézeau發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片 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

In reply to Nicolas Martignoni

Re: PHP help required!

Jason Vickers發表於

Wow nice program.... although didnt work.. lol

Umm, too many errors to list with the GetObject["WinNT bits.