I would advise you to use the Services (<a href="http://drupal.org/project/services">http://drupal.org/project/services</a>) module when handling Flash integration in Drupal; when using the Drupal Form API you get a lot of safety mechanisms that are involved that ensured you can submit the data you submitted, as well as that data is properly formatted. Now you're trying to use a Flash form; having a user service that is running in the background to handle your updates using JSON for example may be a better way to do it. You have a lot of tutorials about Flash/Services integration laying around.<br>
<br><div class="gmail_quote">On Sat, Aug 21, 2010 at 9:33 AM, Rob Koberg <span dir="ltr"><<a href="mailto:rob@koberg.com">rob@koberg.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
Unless I am doing something incorrect (spent the day on it), I can't<br>
get legacy Flash (swf) http form posts to be handled with Drupal. For<br>
example, we have a custom swf avatar builder. The swf, onsubmit, does<br>
a POST with a single parameter. (I don't have the source, but could<br>
legally decompile it and add extra fields(?) for the form identifiers,<br>
if that could help. I know less Flash than PHP)<br>
<br>
I was thinking the easiest way to go would be to make a simple interface:<br>
<br>
$DRUPAL/avatar.php<br>
<br>
<?php<br>
<br>
if (!empty($_POST)) {<br>
<br>
require_once './includes/bootstrap.inc';<br>
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);<br>
<br>
$account = $GLOBALS['user'];<br>
dd('save $account: ' . $account);<br>
<br>
$avatar_xml = $_POST['avatarXML'];// it is url encoded<br>
dd('save $avatar_xml: ' . $avatar_xml);<br>
<br>
} else {<br>
<br>
header('HTTP/1.1 405 Method Not Allowed');<br>
<br>
}<br>
<br>
I get the log entries written and the parameter value, but I don't get<br>
a page user object.<br>
<br>
What I want to do in this case is save a single profile field value,<br>
'profile_avatar_xml' which is added at registration time with default<br>
data. How can I get to the 'global $user;' (which I tried) object so I<br>
can set: $user->profile_avatar_xml = $_POST['avatarXML'];<br>
<br>
thanks,<br>
<font color="#888888">-Rob<br>
</font></blockquote></div><br>