Click here to Skip to main content
15,890,579 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: PHP Google calendar Pin
JR21224-Feb-14 4:38
JR21224-Feb-14 4:38 
GeneralRe: PHP Google calendar Pin
OriginalGriff3-Mar-14 22:51
mveOriginalGriff3-Mar-14 22:51 
Questioni have php class and read file from ftp server and work fine on local machine but i hosted on godaddy then not read file from ftp server Pin
Ajeet Lodhi26-Jan-14 23:29
Ajeet Lodhi26-Jan-14 23:29 
Questioninserting excel data to php myadmin database Pin
Member 1055130526-Jan-14 18:09
Member 1055130526-Jan-14 18:09 
AnswerRe: inserting excel data to php myadmin database Pin
Kornfeld Eliyahu Peter26-Jan-14 20:50
professionalKornfeld Eliyahu Peter26-Jan-14 20:50 
Questionhow run redirection in the background Pin
Jassim Rahma26-Jan-14 10:10
Jassim Rahma26-Jan-14 10:10 
AnswerRe: how run redirection in the background Pin
Graham Breach26-Jan-14 23:45
Graham Breach26-Jan-14 23:45 
QuestionObtain Facebook Access-Token Pin
Jassim Rahma26-Jan-14 8:38
Jassim Rahma26-Jan-14 8:38 
Hi,

I am using the following code to publish a post to Facebook using PHP. I only have one problem left... I want to know how can I obtain an access-token for my page before publishing the post as access-tokens are not permanent.

PHP
<?php
class PublishOnFacebook
{

    function status_update($status_text)
    {
        require_once("facebook/facebook.php");

        $config = array();
        $config['pageId'] = 'xxxxxxxxxx';
        $config['appId'] = 'yyyyyyyyyy';
        $config['secret'] = 'zzzzzzzzzzzzz';
        $config['fileUpload'] = false;

        $fb = new Facebook($config);

        $params = array(
          "access_token" => $config['appId'] . "|" . $config['secret'],
          "message" => $status_text,
          "link" => "http://www.pontikis.net/blog/auto_post_on_facebook_with_php",
          "picture" => "http://i.imgur.com/lHkOsiH.png",
          "name" => "How to Auto Post on Facebook with PHP",
          "caption" => "www.pontikis.net",
          "description" => "Automatically post on Facebook with PHP using Facebook PHP SDK. How to create a Facebook app. Obtain and extend Facebook access tokens. Cron automation."
        );

        try
        {
          $ret = $fb->api('/xxxxxxxxxx/feed', 'POST', $params);
          echo 'Successfully posted to Facebook';
        } 
        catch(Exception $e)
        {
          echo $e->getMessage();
        }
    }
}
?>



Technology News @ www.JassimRahma.com

AnswerRe: Obtain Facebook Access-Token Pin
Richard MacCutchan26-Jan-14 21:55
mveRichard MacCutchan26-Jan-14 21:55 
QuestionProblem creating a PDO Object with Rewriting On Pin
Mike Dev Br24-Jan-14 2:24
Mike Dev Br24-Jan-14 2:24 
AnswerRe: Problem creating a PDO Object with Rewriting On Pin
Mike Dev Br26-Jan-14 7:34
Mike Dev Br26-Jan-14 7:34 
GeneralRe: Problem creating a PDO Object with Rewriting On Pin
Mike Dev Br26-Jan-14 13:15
Mike Dev Br26-Jan-14 13:15 
Questionwhy web font is not working on IE Pin
Jassim Rahma21-Jan-14 11:09
Jassim Rahma21-Jan-14 11:09 
AnswerRe: why web font is not working on IE Pin
Graham Breach21-Jan-14 21:30
Graham Breach21-Jan-14 21:30 
Questionwhy my PHP is NOT ignoring the <select>? Pin
Jassim Rahma10-Jan-14 2:44
Jassim Rahma10-Jan-14 2:44 
AnswerRe: why my PHP is NOT ignoring the <select>? Pin
Kornfeld Eliyahu Peter19-Jan-14 23:52
professionalKornfeld Eliyahu Peter19-Jan-14 23:52 
QuestionVideo tag cross browser issue Pin
shajis0019-Jan-14 19:33
professionalshajis0019-Jan-14 19:33 
AnswerRe: Video tag cross browser issue Pin
thatraja19-Jan-14 22:14
professionalthatraja19-Jan-14 22:14 
Questioncan't login to my wordpress Admin page after changing The URL 's Pin
Davood Riazi8-Jan-14 22:45
Davood Riazi8-Jan-14 22:45 
AnswerRe: can't login to my wordpress Admin page after changing The URL 's Pin
Richard MacCutchan8-Jan-14 23:40
mveRichard MacCutchan8-Jan-14 23:40 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
Davood Riazi9-Jan-14 3:18
Davood Riazi9-Jan-14 3:18 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
Davood Riazi9-Jan-14 9:46
Davood Riazi9-Jan-14 9:46 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
User 17164929-Jan-14 10:24
professionalUser 17164929-Jan-14 10:24 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
Davood Riazi9-Jan-14 19:21
Davood Riazi9-Jan-14 19:21 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
Richard Deeming10-Jan-14 1:49
mveRichard Deeming10-Jan-14 1:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.