all groups > flash data integration > july 2007 >
You're in the

flash data integration

group:

flash to XML via ASP or .net


flash to XML via ASP or .net cramerhwood
7/27/2007 5:29:32 PM
flash data integration: I am trying to get a simple guestbook/shoutbox working for a buddy's site, but
am having trouble getting the form data to save back to the xml file. I can
load the xml into flash no problem. The server side script was written in php
and does not look for a variable but uses "$HTTP_RAW_POST_DATA; " which I
guess just posts the data in raw format however it recieves it. I have not
however been able to find an asp equivalent to this. The php code is as
follows:
[Q]<?php
$file = fopen("guestbook.xml", "w+") or die("Can't open XML file");
$xmlString = $HTTP_RAW_POST_DATA;
if(!fwrite($file, $xmlString)){
print "Error writing to XML-file";
}
print $xmlString."\n";
fclose($file);
?>[/Q]
I tried using this asp script, but with no luck:
[Q]<%
Dim objFSO, theFile, theData, objFileStream
set objFSO = Server.CreateObject("Scripting.FileSystemObject")
theFile = "guestbook1.xml"
theData = Request.Form("")

If Not objFSO.FileExists(theFile) Then
' I figure it is best to error check first
Response.Write "Sorry, this file does not exist."
Else
' We have a file!
set objFileStream = objFSO.OpenTextFile(theFile, ForAppending)
objFileStream.WriteLine(theData)
objFileStream.Close
set objFileStream = nothing
Response.Write theData
End If

set objFSO = nothing
%>[/Q]

Any help would be greatly appreciated. I am spending way to much time on this.
Re: flash to XML via ASP or .net dan mode ->Adobe Community Expert
7/30/2007 3:17:08 PM
Kirupa has a php version here: http://www.kirupa.com/web/xml_guestbook.htm


--

Dan Mode
--> Adobe Community Expert
*Flash Helps* http://www.smithmediafusion.com/blog/?cat=11
*THE online Radio* http://www.tornadostream.com <--check this
***Stop Piracy http://www.adobe.com/aboutadobe/antipiracy/***

[quoted text, click to view]

Re: flash to XML via ASP or .net cramerhwood
7/31/2007 6:46:37 PM
Re: flash to XML via ASP or .net adrian281990
8/17/2007 12:00:00 AM
How do you load the XML file? and what ActionScript version your are using. I have a similar problem I ahve to load a XML file via ASP and I don't know how to do this?
Thank you,
AddThis Social Bookmark Button