| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| General Bill ![]() | Convert PHP to ASP How would you convert this function to asp: PHP Code:
__________________ A good name is rather to be chosen than great riches, and loving favour rather than silver and gold. Proverbs 22:1 |
| |
| | #2 (permalink) |
| Master Your Domains | Hi, Bill... no time to debug or test it, but this should be the right general direction... Code: Function helloWorld()
dim text1,text2,param,stuff
dim handle
text1 = "hello world"
text2 = "goodbye world"
MySer = Server.CreateObject("WDDX.Serializer.1")
handle = Server.CreateObject("Msxml2.ServerXMLHTTP")
If (Request.QueryString("yea")) Then
If (Mid(Request.QueryString("yea"), 0, 3) === "yea") Then
helloWorld = MySer.Serialize(array(text1,text2));
End If
End If
param1 = Server.URLEncode(text1)
handle.open "GET", param1 & param2, False
handle.send
stuff = handle.responseText
handle = Nothing
helloWorld = stuff
End Function
~ Nexus Last edited by Nexus; 11-18-2004 at 12:51 PM. |
| |
| | #5 (permalink) | |
| Senior Member | Quote:
__________________ Download youtube videos at www.HugYouTube.com and free domains list atwww.FreeDroplists.com Anonymous access at www.Banned.net | |
| |
| | #6 (permalink) | |
| Master Your Domains | Quote:
Bill, if you weren't bound by the above (your code is nastled in a bunch of other VB code), I'd use Javascript for your language interpreter. PHP is much easier to port to Javascript than VBscript. You get to keep your "{" and "}" structures, and your ";" at the end of your lines. ~ Nexus | |
| |
| | #7 (permalink) |
| General Bill ![]() | If I serialize an asp array with this: helloWorld = MySer.Serialize(array(text1,text2)); Can I unsearialize it with php unserialize?
__________________ A good name is rather to be chosen than great riches, and loving favour rather than silver and gold. Proverbs 22:1 |
| |
| | #8 (permalink) |
| Master Your Domains | Not really... put you'd be able to convert it. The MS serialization method "serializes" to XML. If you have a particular XML to array function you use in PHP, then that would solve it. I have one I use I could pass to you. You'd just need to compare the array you're expecting with the array you get (from doing this), and adjust it however necessary. ~ Nexus |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |