<?php

$hawin32 = new COM("HAWin32");
$haScript = $hawin32->haInitialize("hawphp");

//$haScript->haSizeHyperACCESS(3); //uncomment if you want haw visible
$haScript->haOpenSession("session.HAW");
$haScript->haConnectSession(0);
$haScript->haWaitForConnection(1, 100000);

$haScript->haWaitForPrompt("some prompt>");
$haScript->haTypeText("some command\r");

$haScript->haWaitForString("\r");
$datastr = $haScript->haGetInput(0, -1, 10000, 10000);
echo "<p>$datastr</p>";

$haScript->haDisconnectSession();
$haScript->haWaitForConnection(2, 100000);

$haScript->haTerminate();

?>

To execute this sample save the above code as a php file on your php server. Visit the page to execute the script. The script will connect to a device, issue some command, and display the result on the web page.

Return to sample script index

Hilgraeve