Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - viulian

Pages: 1 2 [3]
31
Well :) "a" means append..
I don't think it will be a well formed XML what you get, because you will have something like:

Code: [Select]
<root>
  <value>
    10
  </value>
</root>
<root>
  <value>
    10
  </value>
</root>

Which is not a good XML as it doesn't have a root node - a single node that embeds everything else..

But if you can parse this structure which is not a well formed XML, then it's ok I guess.

For more reading: http://en.wikipedia.org/wiki/XML where it says:

Every XML document must have exactly one top-level root element (alternatively called the document element), so the following would also be a malformed XML document: it has two top-level thing elements, with no overall parent element encasing them both.

<?xml version="1.0" encoding="UTF-8"?>
<!-- WRONG! NOT WELL-FORMED XML! -->
<thing>Thing one</thing>
<thing>Thing two</thing>


32
Thank you too :) and good luck!

33
Thanks :)

About appending nodes to an XML file instead of writing it down from zero... there are a couple of solutions.
If you run PHP 5, you can use http://php.net/simplexml to read the XML sent from flash [pick up the nodes that is] and then read update the XML on disk with the new nodes.

For older PHPs, you can search the web for something like PHP XML class, or PHP xml simple.. and pick up the one best suited for your goal.

But there is a problem: what would happen if two users would click 'Save' and then the web server will try to update the XML on disk with two changes simultaneously ? One of the changes will be lost when the script that runs last will update the file on disk.
If you want to save data on disk and plan on offering the flash to >10 users which might click Save at the same time, I guess it's better if you save each request separately. Then, when you want to access the data saved as XML, you will just read all the files and create a big XML and then use that..

---

About the redirect ...
I think it will try to do the redirect anyway (if you press on Save because it does a POST) so the choice would be to redirect to the same page containing the flash which lets the user enter the data (basically a reload).
Or maybe you can change the 'Save' button properties and make it not to be a submit button, but a simple button (which won't trigger a redirect but just make a background call to the save.php script - AJAX like behaviour, for example).

I don't have Macromedia anymore - did this tutorial a year ago or so, so that as far as I can help..

34
Thanks for the kind words :)

I've pasted the code below. It is minimalistic so it can be easily adapted to any use..

Code: [Select]
<?php
//Capture data from $_POST array
$myxml $GLOBALS['HTTP_RAW_POST_DATA'];
//Make one big string in a format Flash understand
//Open a file in write mode
$fp fopen("value.xml""w");
$ok fwrite($fp$myxml);
fclose($fp);

if (
$ok)
        
header('Location:http://hex.ro/files/flashxml/Display.html');
else
        echo 
"writing=Error&";

?>

I'll also update the webpage now..

35
Java SMF Backup / Re: secs or sc input field?
« on: February 19, 2007, 08:10:31 pm »
I think there is a problem with the authentication on the forum (it redirects to some other page when something goes wrong and then the application won't find the sesc (or sc) parameter in the page).

I cannot ask to see the log files as they do contain your sensitive information..

What you should do is install an HTTP proxy (such as Charles http://www.xk72.com/charles/ - it's shareware, but you can use it for 30 days).
After you set it up, please set the proxy parameters in Java SMF Backup to point to localhost and the port you have started Charles on.

Then watch the dialog between the application and your forum, and then click on the last page that is sent back from the forum to the application.

You should be able to see (if you save the text from Charles to an .html page) what was the error message.
I guess it's something related to the session authentication - but can't actually say what goes wrong..
(i mean it's a trade off - no matter how much logging I can put in the application, only the user is able to investigate what goes on - as there are privacy issues to take into account).

I guess Charles is an easy solution.. You should see what is the page returned by the forum when you try to connect via the application (it will contain an error message sent by the forum instead of the admin page which has the sc or sesc parameter).

Hope this helps :) please keep me posted.

36
Java SMF Backup / Re: secs or sc input field?
« on: February 19, 2007, 08:47:42 am »
Hi :)

Do you use an .htaccess with redirects ?

Usually, when you log into the forum, the forum will answer back with a page containing the session (sc or sesc - don't know in fact if its the session, its a parameter which if its missing, any admin operation will not work).

The trouble is that:
a) mistyped password
b) redirects (or other processes) which intercept the login page (such as addons on the forum).

Make sure that the index.php you are pointing your URL to is the SMF one's and not the index.php of some portal/wrapper over the forum..

37
Perl File Indexer / This only works with ActivePerl and not cygwin.
« on: February 05, 2007, 03:23:15 pm »
FYI, Perl File Indexer only works with ActivePerl for Windows..

38
Java SMF Backup / Java SMB Backup goes live on simplemachines.org!
« on: February 05, 2007, 03:19:27 pm »
Java SMF Backup was published on http://www.simplemachines.org/download/?tools on 01 Feb. 2007 :)

Pages: 1 2 [3]