سؤال

I have very simple form (the file is called message.php):

<?php
  print_r($_POST);
?>
<form method="post" target="_top" action="<?php echo CANVAS_URL;?>message.php">
  <input type="text" name="your_name" />
  <input type="hidden" name="signed_request" value="<?php echo $_REQUEST['signed_request'];?>" />
  <input type="submit" name="send" />
</form>

I found one solution of this issue - put into the form hidden input with the signed_request - I did it but unfortunately I am still facing with this problem -- I cannot retrieve sent POST data.

If I change the method to method="get", everything is working well, but I would need to data from POST.

Could anyone help me, how to solve this problem? Thanks!

هل كانت مفيدة؟

المحلول

Try this. I don't believe you need to use target in FB canvas aps anymore. Also a form ID would be good.

<form method="POST" id="my_form" action="message.php">
    <input type="text" name="your_name" />
    <input type="hidden" value="<?php print $_POST["signed_request"] ?>" name="signed_request" />
    <input type="submit" name="submit" />
</form>

نصائح أخرى

POSTing to Canvas URLs (as in http://apps.facebook.com/namespace) is simply not supported. But why post to the top window instead of simply staying within the iframe? It's way better as it doesn't require the entire page to be reloaded, only the iframe.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top