<?
$ Aspservername: this variable must have an IP address in
In the/etc/hosts file.
$ Aspport: ASP file server port number.
$ Asppath: the ASP file path on the server side.
$ Aspfile: ASP file name
$ Aspurlredirect: $ ASP file parameters.
// Set variables
$ Aspservername = "web_sqlserver ";
$ Aspport = 80;
$ Asppath = "/development/sqlserver /";
$ Aspfile = "storedprocs. asp? ";
$ Aspurlredirect = "clienthostpage =". strstr ($ script_name ,"/");
// Connect to the IIS/ASP Server
$ Fp = fsockopen ($ aspservername, $ aspport, & $ errno, & $ errstr );
If ($ FP ){
// Get mode to server
$ Srequest = "get". $ asppath. $ aspfile;
$ Sprotocol = "HTTP/1.0 \ n ";
If (! Strlen (CHOP ($ QUERY_STRING ))){
$ Httpget = $ srequest. $ aspurlredirect. $ sprotocol;
} Else {
$ Httpget = $ srequest. $ QUERY_STRING. $ sprotocol;
}
// Send a request from the client to the ASP file
Fputs ($ FP, $ httpget );
// Process the returned results
While (! Feof ($ FP )){
$ Line = fgets ($ FP, 128 );
// Display the results returned by the ASP file
If ($ btripped ){
Echo $ line;
} Else {
// Process IIS header information
$ Btripped = strstr (strtoupper ($ line), "<HTML> ");
If ($ btripped) echo $ line;
}
}
Fclose ($ FP );
} Else {
Echo "$ errstr ($ errno) <br> \ n ";
}
?>