Note that there are some explanatory texts on larger screens.

plurals
  1. POPost Facebook status with PHP - Need Help in $_POST
    text
    copied!<p>On my site I have some texts with button below so that user can post that text directly as their facebook status I use Form POST request to post that status to my fbapp. </p> <p>Problem is when user first time use this feature then Apps Request for permission window appears after user ALLOW it then my fbapp page appears which is set in FORM action and the text which I sent via POST gets posted to that page as NULL value</p> <p>but when user again use this feature(i.e. permission window dnt appear) it directly goes to my fbapp page text succesfully posted as status.</p> <p>code used is :</p> <pre><code>&lt;?php if(isset($_POST['mystatus'])) { $status = $_POST['mystatus']; } require_once 'facebook.php'; $facebook = new Facebook(array( 'appId' =&gt; xxxxxx, 'secret' =&gt; xxxxxxxxxx, )); $user = $facebook-&gt;getUser(); if($user) { } else { $params = array( 'scope' =&gt; 'publish_stream' ); $loginUrl = $facebook-&gt;getLoginUrl($params); header('location:' .$loginUrl); } ?&gt; &lt;html&gt; &lt;body&gt; if ($user) { ................................... rest of the usual php sdk code here .................................... } else { echo("&lt;script&gt; top.location.href='" . $loginUrl . "'&lt;/script&gt;"); } &lt;/body&gt; &lt;/html&gt; </code></pre> <p>If user already granted permission to App &amp; Use this feature 2nd time then Apps Request for permission window dnt appear text status is posted as <code>$_POST['mystatus']</code> and updated successfully on user id.</p> <p>Problem is only when Apps Request for permission window appears after user allow the application then <code>$_POST['mystatus']</code> dnt get value and status is updated as <code>NULL</code> on user id.</p> <p>pls HELP how to solve this.</p> <p><strong>IF USER DISALLOW OR REMOVE APP.</strong> also I want to know How can I show Error Message on page If User dnt Allow Application Request. &amp; if once used later remove the application then page shows this error:</p> <pre><code>Fatal error: Uncaught OAuthException: Error validating access token: User xxxxxxxxxxx has not authorized application xxxxxxxxxxxxxxxxxxx. thrown in base_facebook.php on line 1106 </code></pre> <p>Is there any way to show custom message to user instead of this error ?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload