Jump to content

Search the Community

Showing results for tags 'facebook api'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. please if i share or post a link to my website on facebook, and everyone who wants to download your report has to share the same link on his own wall to download the report and visitors coming from that link also have to do the same. How can i do this with a code? Thanks.
  2. Hi I am trying to create some code that will post content to somebody's facebook wall once they login, get their login email address, email it across to me, then redirect the user back to my main website. I have the code to paste to the wall: <? $app_id = "115920985216230"; $your_website_link="http://www.mywebsite.com"; $picture="http://www.mywebsite.comimages/unhappy.jpg"; $title="Do you HATE your weight?!!!"; $description="The fat loss factor is the new way to lose weight, share on your wall and get a free sample now "; $redirect_user="http://www.mywebsite.com/sample.php"; $message="GET A FREE SAMPLE NOW"; $feed_url = "http://www.facebook.com/dialog/feed?app_id=". $app_id . "&link=".urlencode($your_website_link)."&name=".$title."&picture=".urlencode($picture)."&description=".$description."&redirect_uri=" . urlencode($redirect_user)."&message=".$message; header('Location: '.$feed_url); if (empty($_REQUEST["post_id"])) { echo("<script> top.location.href='" . $feed_url . "'</script>"); } else { echo ("Feed Post Id: " . $_REQUEST["post_id"]); } ?> My problem is how do I grab the email address of the user? I tried the following code but it didn't work: <?php // Begin loading the necessary files for the Facebook SDK. require ( 'autoload.php' ); // Load the required PHP classes from the Facebook SDK. use Facebook\FacebookSession; use Facebook\FacebookRedirectLoginHelper; use Facebook\FacebookRequest; // Start the session session_start(); // Initialize the Facebook app using the application ID and secret. FacebookSession::setDefaultApplication( '115920985216230','d4dda3997902353d23958d1c7dfeb670' ); // Define Facebook's login helper and redirect back to our page. $helper = new FacebookRedirectLoginHelper( 'http://www.mysite.com/sample.php' ); // Check to ensure our session was started correctly and the access token exists. if ( isset( $_SESSION ) && isset( $_SESSION['fb_token'] ) ) { // Using the access token, create a new session. $session = new FacebookSession( $_SESSION['fb_token'] ); // Determine if the defined session is indeed valid. if ( !$session->validate() ) { $session = null; } } // Check if an active session exists. if ( !isset( $session ) || $session === null ) { // If no session exists, let's try to create one. $session = $helper->getSessionFromRedirect(); } // Make sure we have a session started. if ( isset( $session ) ) { // Save the session $_SESSION['fb_token'] = $session->getToken(); // Create a new Facebook session using our token. $session = new FacebookSession( $session->getToken() ); echo 'Connected to Facebook!'; $user = (new FacebookRequest( $session, 'GET', '/me?fields=id,name' ))->execute()->getGraphObject(GraphUser::className()); $to = 'joeblogs@hotmail.co.uk'; $subject = 'User data'; $message = $user; $headers = 'From: joeblogs@gmail.com' . "\r\n" . 'Reply-To: brittosd@gmail.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> So basically I need some code that uses the new facebook SDK for php that does both, i.e. shares content on the user's wall, emails me the user's email address then redirects them to a page on my website. Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.