PHP and COM
If you're an adventurer and you're running PHP on a CGI, ISAPI, or Apache version of the Windows system, you can also get the COM functionality of the system. Now, the work of explaining COM (the Component Object model of Microsoft) is left to Microsoft and those voluminous books to complete. However, there is nothing wrong with knowing dot com, there is a common (no pun, for very ordinary) code small fragment.
This little snippet of code uses PHP to start Microsoft Word in the background, open a new file, type some text, save the file, and then close the application:
Create a reference to a new COM component (Word)
$word = new COM ("Word.Application") or Die ("Can ' t start word!");
Print the version of Word ' s now
echo "Loading Word, v. {$word->version}
";
Set the visibility of the application to 0 (false)
To open the application in the forefront, use 1 (true)
$word->visible = 0;
Create a new document in Word
$word->documents->add ();
Add text to the new document
$word->selection->typetext ("Testing ...");
Save the document in the Windows temp directory
$word->documents[1]->saveas ("/windows/temp/comtest.doc");
Close the connection to the COM component
$word->quit ();
Print another message to the screen
echo "Check for the file ...";
?>
Suppose you are running an intranet Web site that stores data in a Microsoft SQL server database, and your users need data in Excel format. So, you can have PHP execute the necessary SQL queries and format the output, then use COM to start Excel, transfer the data to it, and then store the files in the user's desktop system.
The above describes the Acronisdiskdirector10 PHP script 10 tips 6, including the acronisdiskdirector10 aspect of the content, I hope that the PHP tutorial interested in a friend to help.