Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Location
    malaysia
    Posts
    44

    Question Calling Windows DLL's from PHP

    This is ASP Code how to call the function

    'SentMsg = "01/10 Test<LF>1234567890QWERTYUIOP"
    'AnnounceParameter = encodeParameter(761110001650,1630,1453220,"1",SentMsg)
    'AnnounceString = "/scripts/openagent_HTTP.dll?Announce&" & AnnounceParameter
    'Response.Write "<SCRIPT language=""Javascript"" type=""text/javascript"">" & vbCr
    'Response.Write "function channelOn()" & vbCr
    'Response.Write "{" & vbCr
    'Response.Write " openString = """ & AnnounceString & """" & vbCr
    'Response.Write " window.open(openString, ""TurnOnWindow"", ""locationbar=no, scrollbars=yes, toolbar=no, resizable=no"")" & vbCr
    'Response.Write "}" & vbCr
    'Response.Write "</SCRIPT>" & vbCr

    How to implement in PHP, please help

    Thanks in advance
    stephenvs

  2. #2
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,099
    what does encodeParameter() do exactly?
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  3. #3
    Join Date
    Apr 2004
    Location
    malaysia
    Posts
    44

    please help me, Is it possible that we can call the windows dll in the PHP?

    It is just normal function to change value into ascii, basic function call throgh dll is "turnon", "setdate"

    openUrgentString = "/scripts/openagent_HTTP.dll?SetDate&" & openUrgentParameter

    the above two line shows call the particualar dll,followed by function name call "SetDate" and parameter values then pass through the "openUrgentParameter(which contain values such as (v1,v2,v3,v4....n)"

    please help me, Is it possible that we can call the windows dll in the PHP?, please stat how

    thanks
    stephenvs

  4. #4
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,099
    You are actually not calling the dll from your ASP snippet above.

    What you are doing is writing vbscript that will open a window with the specific URL. You can do this in PHP, by simply echoing the same text "/scripts/openagent_HTTP.dll?SetDate&".$somedate in PHP.

    The actual "calling" of the script is done by the web browser, since you are opening a new window with that script as the URL.

    If you want to execute the script, and then read the results back, you can use any number of ways in PHP (fopen -- if URL wrappers are enabled), file(), etc.

    For example -- assuming the script is on http://www.myserver.com

    PHP Code:
    $results file("http://www.myserver.com/scripts/foo.dll?param1=value1&param2=value2");

    echo 
    "<pre>"print_r($results); echo "</pre>"
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  5. #5
    If you have sufficient access to the server, you can use shell_exec(..) php command to run any C++ executable there. This executable can interoperate with the dll.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •