php - Accessing POST data in Facebook cavas app -


so i've got simple form in canvas / iframe facebook app, , i'm trying pass along values post. reading on s.o. , fb's latest docs, understand it, data send via post form can accessed on receiving end $_request object.

i read on thread on s.o. in order post forms work need pass along input named "signed_request" value current signed_request (i have signed request working ok otherwise...all login , authentication stuff working fine). isnt mentioned anywhere in official fb docs.

so problem comes in $_request object signed request, , bunch of other session stuff. form inputs found.

the way can read them set method of form "request" isn't real form method. takes of inputs , sends them args in url. horrible. here's sample page canvas app form i'm using try debug (leaving out authentication stuff):

<form enctype="application/x-www-form-urlencoded" method="post" target="_top" id="my_form" action="https://apps.facebook.com/myfakeapp/form_test.php"> <input type="text" name="test1" value="58" /> <input type="text" name="test2" value="123" /> <input type="text" name="test3" value="434" /> <input type="text" name="test4" value="645" /> <input type="text" name="signed_request" value="<? echo $_request['signed_request']; ?>"> <input value="submit answers" type="submit"> </form> 

the fb docs confusing of refers beta migration mode had older apps dealing post requests canvas apps.

any ideas? thanks!

you combining 2 separate techniques...the purpose of submitting form target=_top , action=apps.facebook.com/xxx facebook automatically send signed_request parameter. if sending yourself, should use page's "external" address action , leave target attribute off. using target=_top, reloading entire framework , sending form data facebook, of course ignores it.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

c# - Getting control value when switching a view as part of a multiview -