home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / bb98.exe / SOword.php < prev    next >
PHP Script  |  2002-09-02  |  1KB  |  36 lines

  1. <?php if (!defined("SOWord")) { define("SOWord", 1);
  2.  
  3. include("SOhttp.php");
  4.  
  5. //    Retrieve Word file in HTML format.
  6. //    Inputs:
  7. //        $sAddr: address of BadBlue server (e.g., "127.0.0.1:8080")
  8. //        $sPath: path of shared file in EXT.INI file (e.g., "path3")
  9. //        $sFile: name of Word document to convert to HTML (e.g., "memo.doc")
  10. //        $sPage: [by reference] return variable set to the document contents
  11. //        $sUser: (optional) user-name to get access to file
  12. //        $sPassword: (optional) password to get access to file
  13. //    Outputs:
  14. //        $errmsg: empty if no error occurred, otherwise error message
  15. //
  16. function SOWord($sAddr, $sPath, $sFile, &$sPage,
  17.                 $sUser = "", $sPassword = "") {
  18.     $errmsg = "";
  19.     do {
  20.  
  21.         //    Construct URL and grab page...
  22.         //
  23.         $sURL = "http://".$sAddr."/ext.dll?MfcISAPICommand=LoadPage&".
  24.                 "page=doc.htx&a0=/get/".$sPath."/".rawurlencode($sFile).
  25.                 "&a1=_&a2=2048&a3=8&a4=1";
  26.         $errmsg = SOHTTPGet($sURL, &$sPage, $sUser, $sPassword);
  27.         if (strlen($errmsg)) {
  28.             break;
  29.         }
  30.  
  31.     } while (0);
  32.     return ($errmsg);
  33. }
  34.  
  35. } ?>
  36.