We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


ASP, PHP, or XML Question

itsmedtt asked
Medium Priority
Last Modified: 2013-12-13
We need to create XML parsing. Company XYZ has developed a program for us to use. We are supposed to have replicated sites and Company XYZ controls the backend database. We have to create something to get their data. We have to program a code to pull the url to get a repid(user id)  from the rename(user name), and the repid has to imported into the website so that the repid can be associated to an iframe and edi.asp calls.

Example: http://mywebsite.com/myname myname has to be pulled from the url, get the associated repid, then associate a name, email, order data, and such with it. After the data is pulled in storage, we needto hold it storage and use it later that session in an iframe or page to associate repid with sales, signups, and pull contact info into a page.
The edi.asp link points to XML data. We need to extract that that based on repid and display it into a webpage and associate sales to distributor that sent them to the site.
Sample url we have to extract xml data from. http://shop.mywebsite.com/EDI.asp?companyid=111&apikey=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa&type=countries (numbers have been changed for security)
here is a sample code they sent us:
VBScript as your scripting language: Can this be translated from asp to PHP in order to use on a linux server to get the xml data from a sql database using asp.net?

VBScript as your scripting language:
            function fcnGetXML(RepURL) 
                        DataToSend = "companyid=111&apikey=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&type=reps&sitename=" & RepURL
                        servername = cstr(request.ServerVariables("Server_Name"))
                        postUrl = "http://subdomain.mywebsite.com/EDI.asp"
                        'Set url to send request to including web service name.
                        postUrl = postUrl                  
                        Set xmlhttp = server.Createobject("MSXML2.XMLHTTP")
                        'Prepare request header.
                        xmlhttp.Open "POST",postUrl,false
                        xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"                      
                        'Send request:
                        xmlhttp.send DataToSend
                        If cstr(xmlhttp.Status) = "200" then
                                    'Success, parse result
                                    fcnGetXML = xmlhttp.responseText
                                    'failure handle failure
                                    fcnGetXML = "0"
                        End if
            end function

Open in new window

Watch Question

Top Expert 2007

Top Expert 2007
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Most Valuable Expert 2011
Author of the Year 2014
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview


Thanks for your replies. Let me check these out and I will get back to you.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.