Link to home
Start Free TrialLog in
Avatar of itdeptneci
itdeptneci

asked on

VB script on IIS to php on Apache

Does anybody have experience with PHP and VB. I've had a request for this small bit of code to be run on an Apache server. (Attached file shows full asp file)

            DT700Location = Cstr(.QueryString("DT700Location"))
            'ServerPageToFetch = Cstr(.QueryString("ServerPageToFetch"))
            ServerPageToFetch = "http://192.168.1.115/EUSDK/default.xml"
            
            'Test with fixed value DT700Location = "http://192.168.1.63:5555/cgi/Push.cgi"
            
            strPOSTxml ="<DtermIPPush><PushItem type=""0"" URL=""" & ServerPageToFetch & """/></DtermIPPush>"

            dim xmlhttp
            set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
            xmlhttp.Open "POST", DT700Location, false
            xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            xmlhttp.send strPOSTxml
Push04.asp.txt
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

That's confusing.  What is supposed to run on IIS and what is supposed to run on Apache?  Note that POST and GET are HTTP protocols/commands and they work the same whether they come from ASP or PHP.
Avatar of itdeptneci
itdeptneci

ASKER

Sorry if there's any confusion.

That's my VB code that I have running happily on IIS.

I want the equivalent in PHP on Apache if it's possible?
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok I'm being lazy not wanting to learn PHP. This really is a one off.

Is this easy in PHP? I just need an example for a PHP developer to understand my VB. It doesn't have to be bullet proof...

dim xmlhttp
set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST", "http://192.168.1.63:5555/cgi/Push.cgi", false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send "<DtermIPPush><PushItem type=""0"" URL=""http://192.168.1.115/EUSDK/default.xml""/></DtermIPPush>"
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial