Jump to content

ASP - PHP (translation) - help needed - please take 2-5 min to help me.


N1KO

Recommended Posts

Attached is all the files needed to make a translation. I am a Flash Programmer in need of a PHP vertion of the ASP files described here. They are extreamly simple and short, so it should be a walk in the park for anyone who understands ASP and PHP even remotely.. I have made several attempts in doing it my self, but just can't get to the right info.. Please help me, I would be very gratfull. Thank you in advanced..

 

XMLObjectWDatasetParams.fla

 

var myXML:XML = new XML();
var sendXML:XML = new XML("<data><nametype>2</nametype></data>");
myXML.ignoreWhite = true;
myXML.onLoad = function(success) { 
if(success) {
	for (var x=0;x<this.firstChild.childNodes.length;x++) {
		var empNode:XMLNode = this.firstChild.childNodes[x];
		employees_ds.addItem({empid:empNode.attributes.empid,
							  empname:empNode.attributes.empname,
							  dept:empNode.attributes.dept });
	}
} else {
	//Throw error here
}
}
sendXML.sendAndLoad("http://localhost/getXMLWParams.asp",myXML);

 

loadvars.fla

 

var myLoadVars:LoadVars = new LoadVars();
myLoadVars.onLoad = function(success) {
if (success) {
	trace(myLoadVars.name1);
	trace(myLoadVars.name2);
} else {
	//Throw error here
}
}
myLoadVars.load("http://localhost/loadvars.asp");

 

getXMLWParams.asp

 

<%

response.ContentType="TEXT/XML"

Set docReceived = CreateObject("MSXML2.DOMDocument") 
docReceived.async = False 
docReceived.load Request 
Set RequestRoot = docReceived.documentElement
nametype =	RequestRoot.getElementsByTagName("nametype")(0).text

if nametype = "1" then
response.write ("<?xml version='1.0'?><results_packet><rec empid='125' empname='Bill Frye' dept='Admin'/><rec empid='126' empname='Janice Corning' dept='Admin'/><rec empid='122' empname='John Taylor' dept='IS'/><rec empid='123' empname='Michelle Heinz' dept='Graphics'/><rec empid='121' empname='Phil Heinz' dept='Sales'/><rec empid='124' empname='Sarah Johnson' dept='Accounting'/></results_packet>")
else
response.write ("<?xml version='1.0'?><results_packet><rec empid='125' empname='Bill F' dept='Admin'/><rec empid='126' empname='Janice C' dept='Admin'/><rec empid='122' empname='John T' dept='IS'/><rec empid='123' empname='Michelle H' dept='Graphics'/><rec empid='121' empname='Phil H' dept='Sales'/><rec empid='124' empname='Sarah J' dept='Accounting'/></results_packet>")
end if

response.end
%>

 

loadvarsSend.asp

 

<%
response.write "&name1=" & request("param1") & "&name2=" & request("param2") & "&"
response.end
%>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.