Search Results

Search found 41996 results on 1680 pages for 'facebook php sdk'.

Page 18/1680 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • How to return a value from facebook javascript connect api fucntions

    - by dezwald
    I am trying to create wrapper functions on facebook javascript connect api methods. My problem is that i can not return a value within the facebook api FB_RequireFeatures method. i want my isFBConnected() function to return true or false based on if i'm logged into facebook or not. What is happening is that when i return true it returns it to the child function, which makes sense however, my global "login" variable does not get set to true. I've tried setting a timeout to wait until the facebook connect finishes executing and still no luck. any help or other solutions are welcome! my isFBConnected wrapper function is stated below: function isFBConnected(){ var api_key = '<?=$this->apiKey?>'; var channel_path = '<?=$this->xdReceiver?>'; var host_url = '<?=$this->hostUrl?>'; var servicePathShort = '<?=$this->servicePathShort?>'; var login = false; FB_RequireFeatures(["Api"], function(){ // Create an ApiClient object, passing app's API key and // a site relative URL to xd_receiver.htm FB.Facebook.init(api_key, channel_path); var api = FB.Facebook.apiClient; // If FB user session exists - load stats data if(api.get_session()!=null){ if(api.get_session().uid!='' && api.get_session().uid!=undefined){ login = true; alert(api.get_session().uid); return true; } } login = false; return false; }); return false; }

    Read the article

  • Block facebook from my website

    - by Joseph Szymborski
    I have a secure link direction service I'm running (expiringlinks.co). If I change the headers in php to redirect my visitors, then facebook is able to show a preview of the website I'm redirecting to when users send links to one another via facebook. I wish to avoid this. Right now, I'm using an AJAX call to get the URL and javascript to redirect, but it's causing problems for users who don't use javascript. Here are a number of ways I'd like to block facebook, but I can't seem to get working: I've tried blocking the facebook bot (facebookexternalhit/1.0 and facebookexternalhit/1.1) but it's not working, I don't think they're using them for this functionality. I'm thinking of blocking the facebook IP addresses, but I can't find all of them, and I don't think it'll work unless I get all of them. I've thought of using a CAPTCHA or even a button, but I can't bring myself to do that to my visitors. Not to mention I don't think anyone would use the site. I've searched the facebook docs for meta tags that would "opt-me out", but haven't found one, and doubt that I would trust it if I had. Any creative ideas or any idea how to implement the ones above? Thank you so much in advance!

    Read the article

  • Why can't I access the facebook friends list after reopening a session in ios

    - by user1532390
    I am upgrading to the facebook 3.0 sdk for ios. Things went well, until I tried to open an existing session after relaunching the application. I am trying to access the list of friends for the facebook user. if ([[FBSession activeSession] isOpen]) { [request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { //do something here }]; }else{ [[self session] openWithCompletionHandler:^(FBSession *session, FBSessionState status, NSError *error) { if ([self isValid]) { [request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { //log this error we always get NSLog(@"%@",error); //do something else }]; } }]; } However I get this error: Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x1d92ff40 {com.facebook.sdk:ParsedJSONResponseKey={ body = { error = { code = 2500; message = "An active access token must be used to query information about the current user."; type = OAuthException; }; }; code = 400; }, com.facebook.sdk:HTTPStatusCode=400} I've found that if I use the FBSession reauthorize method it allows me to complete the request without error, but it also means I must show UI or switch apps every time we relaunch the application which is unacceptable. Any suggestions on what I should be doing differently?

    Read the article

  • Multiple Facebook scripts?

    - by J Set
    This may be kind of a dumb question, but the script for the facebook button on the like button page is different from the script on the javascript sdk page, but similar. Did facebook just forget to update the documentation or do I need both scripts? The like button page gives: <div id="fb-root"></div> <script> (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> But on the javascript sdk page: <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : 'YOUR_APP_ID', // App ID channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); // Additional initialization code here }; // Load the SDK Asynchronously (function(d){ var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; ref.parentNode.insertBefore(js, ref); }(document)); </script>

    Read the article

  • Any one point me how to customize facebook share

    - by Venkat
    I am trying to share my own custom url, image, title and description using Facebook and twitter. I am having lot of images and videos in my website. So i want to make my content viral on social websites. I am trying to keep share options for both facebook and twitter for everything individually. If some one share one image i want that image in the sharing thumbnail and url will be the page url with my own title, description. Based on the url i will point the user to that pic in my website. I tried in the below way. Facebook share: <a href="javascript:;" onclick="window.open('http://www.facebook.com/share.php?u=your_page_url','facebook share','resizable=yes,width=700,height=500,scrollbars=yes,status=yes')"><img alt="facebook" src="yourimage.jpg" /></a> Twitter share: <a href="javascript:;" onclick="window.open('https://twitter.com/share','twitter share','resizable=yes,width=700,height=500,scrollbars=yes,status=yes')"><img alt="twitter" src="yourimage.jpg" /></a>

    Read the article

  • How to retrieve user information from facebook using fqlquery?

    - by Ershad
    I have the fql query as shown below. Select uid,profile_url,pic_square from user where name="Ershad" here i am getting a response as below. xml version="1.0" encoding="UTF-8" fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true" But i want all the list.All the details uid,profile_url and pic_square. Please anyone help me out..

    Read the article

  • Facebook SDK , How To Put Name of user in wall post?

    - by Viola Courtney
    I got this code and working fine $access_token = $facebook->getAccessToken(); $vars = array( 'caption' => 'Caption message', 'message' => 'I need help', 'name' => 'I need Help', 'link' => 'http://www.google.com/', 'description' => 'description', 'picture' => '' ); But I want to replace the message or the name in to like : " (name of user) Need Help...

    Read the article

  • How to facebook getuser() after login with javascript SDK

    - by user1848205
    So I have to ask for extended permission by clicking the enter button, but after the login is necessary to refresh the page in order to display the app. Here's my code: <?php require 'facebook.php'; $facebook = new Facebook(array( 'appId' => '< THE APPID >', 'secret' => '< THE SECRET >', 'cookie' => true, )); $user = $facebook->getUser(); if ($user) { try { $user_profile = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); $user = null; } } ?> <body> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : '< THE APPID >', status : true, cookie : true, xfbml : true }); // Additional initialization code such as adding Event Listeners goes here $('#btn-enter').click(function(){ login(); }); }; (function(d){ var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; ref.parentNode.insertBefore(js, ref); }(document)); function login() { FB.login(function(response) { if (response.authResponse) { // connected } else { // cancelled } //}); }, {scope: 'read_friendlists,friends_photos,publish_stream'}); } </script> <?php if ($user): ?> <!--Here is my APP--> <?php else: ?> <a id="btn-enter">Enter</a> <?php endif ?> Is there a better way to do this ? What works for me is: function login() { FB.login(function(response) { if (response.authResponse) { top.location.href='https://the_app_url'; } else { } //}); }, {scope: 'read_friendlists,friends_photos,publish_stream'}); } But this causes the entire page to refresh and is not 'elegant' per se...

    Read the article

  • Apache VirtualHosts define php.ini but extend main php.ini

    - by Hosh Sadiq
    I have a main php.ini file and am wondering if it is possible to specify a custom php.ini for a virtualhost, but this php.ini would extend the main php.ini file, so that only the specified settings are overridden and everything else is taken the main php.ini. For example: I have my main php.ini file in /etc/php5/php.ini, containing all the defaults. Let's say this has everything as default so e.g. allow_url_fopen = On allow_url_include = Off Then I have my virtualhost located at /home/user/php.ini and this contains the following: allow_url_fopen = Off This php would run with first the php.ini in /etc/php5/php.ini then the settings that are in /home/user/php.ini resulting in a configuration where both allow_url_fopen and allow_url_include are set to Off. Edit: Also, if /home/user/php.ini does not exist, it would default back to /etc/php5/php.ini

    Read the article

  • Centos 6.5 -- backported upgrades/php.ini directives included in php 5.3.3

    - by Decave
    PHP 5.3.3 is the latest version of PHP available with the official CentOS 6.5 repos. As most of you know, calling it version '5.3.3' is slightly deceptive because critical bug fixes are actually back ported into version 5.3.3, so in effect 'version 5.3.3' does get upgraded now and then. My question is: aside from manually toggling directives in php.ini, how can you tell which new directives, that were implemented in, and officially supported by, later versions of PHP, are also available in CentOS 6.5's backported PHP 5.3.3? For example, max_input_vars (http://php.net/manual/en/info.configuration.php#ini.max-input-vars) has been available since PHP 5.3.9. IS there an easy way to tell whether CentOS included this in a backported upgrade to 5.3.3? Thanks!

    Read the article

  • iPhone SDK Push notification randomly fails

    - by Jameson
    I have a PHP file with the following content that works perfectly on development ceritficates, but when I switch to a production certificate the PHP errors and gives the below message, but it only does this about 50% of the time. The other 50% it works. Anyone know why this might be happening? <?php // masked for security reason $deviceToken = 'xxxxxx'; // jq $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', dirname(__FILE__)."/prod.pem"); $number = 5; $fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx); if (!$fp) { print "Failed to connect $err $errstr\n"; } else { print "Connection OK\n"; $msg = $_GET['msg']; $payload['aps'] = array('alert' => $msg, 'badge' => 1, 'sound' => 'default'); $payload = json_encode($payload); $msg = chr(0) . pack("n",32) . pack('H*', str_replace(' ', '', $deviceToken)) . pack("n",strlen($payload)) . $payload; print "sending message :" . $payload . "\n"; fwrite($fp, $msg); fclose($fp); } ?> The PHP error: Warning: stream_socket_client() [function.stream-socket-client]: Unable to set local cert chain file `/var/www/vhosts/thissite.com/httpdocs/prod.pem'; Check that your cafile/capath settings include details of your certificate and its issuer in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Warning: stream_socket_client() [function.stream-socket-client]: failed to create an SSL handle in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Failed to connect 0

    Read the article

  • PHP enable sqlite phpinfo states --without-sqlite

    - by Jahmic
    I've seen similar questions but none that address my situation adequately. I'm running Apache and PHP 5.3.6 on a amazon cloud server. phpinfo keeps stating that sqlite is disabled. At least that what it seems from the configure line: './configure' ... '--without-sqlite' In other parts of phpinfo() output: PDO PDO drivers mysql, sqlite PDO Driver for SQLite 3.x enabled SQLite Library 3.6.20 sqlite3 SQLite3 support enabled SQLite3 module version 0.7-dev SQLite Library 3.6.20 Directive Local Value Master Value sqlite3.extension_dir no value no value and at least one the following PHP commands fail: if (!extension_loaded('SQLite') OR !function_exists('sqlite_open')) Yum install states that both sqlite and pdo-lite are already installed. I've tried to enable sqlite by editing my local php.ini by adding: ; Enable sqlite3 extension module extension=sqlite3.so I've checked the main php.ini (/etc/php.ini) and there is nothing specific about disabling it. In fact, there is a sub-conig file loaded in php.d that also specifies this extension as well as another for the pdo-sqlite I'm running of things to look for or try. Any suggestions. How do I find where the PHP configure is stated? Thanks

    Read the article

  • FastCGI Error when installing PHP on IIS7.5

    - by ytoledano
    I'm trying to install MediaWiki on a Win2008r2 server, but can't manage to install PHP. Here's what I did: Grabbed a Zip archive of PHP and unzipped it into C:\PHP. Created two subdirs: c:\PHP\sessiondata and c:\PHP\uploadtemp. Granted modify rights to the IUSR account for the subdirs. Copied php.ini-production as php.ini Edited php.ini and made the following changes: fastcgi.impersonate = 1 cgi.fix_pathinfo = 1 cgi.force_redirect = 0 open_basedir = "c:\inetpub\wwwroot;c:\PHP\uploadtemp;C:\PHP\sessiondata" extension = php_mysql.dll extension_dir = "./ext" upload_tmp_dir = C:\PHP\uploadtemp session.save_path = C:\php\sessiondata Install Web server role, selected CGI and HTTP Redirection options. In the Handler Mappings: Added Module Mapping. Entered the following values: Path = *.php, Module = FastCgiModule, Executable = c:\php\php-cgi.exe, Name = PHP via FastCGI. Created a test page into wwwroot directory: phpinfo.php and set the contents like this: < ?php phpinfo(); ? Browsed to http://localhost/phpinfo.php But then I get: HTTP Error 500.0 - Internal Server Error An unknown FastCGI error occured Detailed Error Information Module: FastCgiModule Notification: ExecuteRequestHandler Handler: PHP via FastCGI Error Code: 0x800736b1 Requested URL: http://localhost:80/phpinfo.php Physical Path: C:\inetpub\wwwroot\phpinfo.php Logon Method: Anonymous Logon User: Anonymous Does anyone know what I'm doing wrong here? Thanks.

    Read the article

  • nginx: php-fastcgi running but php files not executing

    - by Daniel
    I have recently set up a nginx server with PHP running as FastCGI process. The server is running with HTML files however PHP files are downloading instead of displaying and PHP code is not processed. This is what I have in nginx.conf: server { listen 80; server_name pubserver; location ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; } } The command netstat -tulpn | grep :9000 displays the following which indicates php-fastcgi is running and listening on port 9000: tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 2663/php-cgi If it's if any importance my server is running on CentOS 6 and I installed nginx and PHP using the repositories from The Fedora Project.

    Read the article

  • Apache 2.2/PHP is not loading the correct php.ini

    - by Jesper
    I have been struggling with this for days. I have a windows server 2008 where I have installed Apache 2.2, PHP and MySql. I kept getting the error that mysql_connect was an unknown function, so I followed all guides I could find but with no result. I have now noticed that phpinfo says that php.ini dir is C:\Windows. This is strange since I've written this in httpd.conf: PHPIniDir 'c:\PHP\' LoadModule php5_module "c:/PHP/php5apache2_2.dll" AddHandler application/x-httpd-php .php How do I get apache and php to read my php.ini and thereby include mysql?

    Read the article

  • PHP-FPM conf location option when compiling php

    - by Danack
    I'm compiling PHP from source. I would like to set the location that PHP-FPM looks for it's config file. Apparently this option should be set via the configure option: --with-fpm-conf=/etc/php/php-fpm.conf According to http://php-fpm.org/wiki/Configuration_File However using this option on PHP5.5.0 gives the error configure: WARNING: unrecognized options: --with-fpm-conf How do I set where PHP-FPM should look for it's conf file when compiling from source?

    Read the article

  • nginx + php fpm -> 404 php pages - file not found

    - by Mahesh
    *2037 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream server { listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default ipv6only=on; ## listen for ipv6 server_name .site.com; root /var/www/site; error_page 404 /404.php; access_log /var/log/nginx/site.access.log; index index.html index.php; if ($http_host != "www.site.com") { rewrite ^ http://www.site.com$request_uri permanent; } location ~* \.php$ { fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_buffer_size 128k; fastcgi_buffers 256 4k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_read_timeout 240; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; } location ~ /\. { access_log off; log_not_found off; deny all; } location ~ /(libraries|setup/frames|setup/libs) { deny all; return 404; } location ~ ^/uploads/(\d+)/(\d+)/(\d+)/(\d+)/(.*)$ { alias /var/www/site/images/missing.gif; #i need to modify this to show only missing files. right now it is showing missing for all the files. } location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { access_log off; expires 20d; } location /user_uploads/ { location ~ .*\.(php)?$ { deny all; } } location ~ /\.ht { deny all; } } php-fpm config is default and is not touched. The problem is little strange for me. Error pages are showing File not found only if they are .php files. Other error files are clearly calling the 404.php file site.com/test = calls 404.php site.com/test.php = File not found. I am searching and making changes. but it hasn't solved the problem.

    Read the article

  • Location tagging facebook open graph actions so that only friends in that location view in their feeds

    - by Arvind Srinivasan
    Is there a way to tag open graph actions so as to target certain recipients and not others? For example, if my app talks about new coffee shop openings in various cities, is there a way to publish the 'opening' action to the graph, perhaps with location / coordinates, such that this is only seen by friends in that locality? I really don't want to spam my friends in London about an opening I'm excited about in Portland. How can I help facebook with the feed relevance in these cases? I noticed that there is a "place" property on open graph objects - could this somehow be used?

    Read the article

  • Facebook: Sending private messages to FB profile from a static website [migrated]

    - by Frondor
    I need to setup a static website for people to: Complete a form. And using anything from Facebook API, GET the form output via message to a Facebook Profile. I've been punching my head against "facebook developers" page all night long and can't find out how to do it. Seems quite easy, but the problem is that I don't know if you'll get my point :) Like the Send Dialog feature, you can set a certain user as recipient which will be displayed on the "To:" field once the dialog appears. FB.ui({ method: 'send', to: 'UserID', link: 'http://www.nytimes.com/2011/06/15/arts/people-argue-just-to-win-scholars-assert.html', }); Ok, All I need is to be able to use the same behavior but instead of setting a "to:" parameter, I'd like to set a "message:" parameter. I don't know how I can solve this becuase there's no parameter like this on the API actually. This is what I need to build (It's a prototype, this code won't work) <form action="mysite.com" id="order"> <input type="radio" name="chocolate" value="white">White <br/> <input type="radio" name="chocolate" value="black">Black <br/> <input type="submit" value="Order" /> </form> jQuery gets the values $(document).ready(function() { $("#order").on("submit", function(e) { e.preventDefault(); var formOutput = $(this).serialize(); var order = "I'd like to eat" + formOutput + "chocolate"; }); }); Facebook sdk sends this output ('order' string) FB.ui({ method: 'send', //or whatever to: 'UserID', message: order, //Its just an example, note the variable coming from the form link: 'http://www.nytimes.com/2011/06/15/arts/people-argue-just-to-win-scholars-assert.html', }); As we all know, what I wrote isn't possible, so I'm asking for any alternative solution if somebody can give me, I'm not very friendly with facebook APIs :) I though in another solution which consist in using the form output directly on the 'link:' parameter of FB.ui and then reading it with jQuery on some landing page. For example, on the message sent, the linked content redirects to this URL: http://mysite.com/dashboard.html?chocolate=white and the dashboard page source code: <script> var choco = getUrlParameter('chocolate'); $("#dashboard").text("This person wants" + choco + "chocolate") </script> <div id="dashboard"></div> And this way, I will be able to see which kind of chocolate the person selected by parsing some parameters on the URL when clicking on the link section of the message: using a code like this: FB.ui({ method: 'send', //or whatever to: 'MyUserID', link: 'http://mysite.com/dashboard.html?chocolate=white', }); But no this try, my biggest problem is that I don't know how to dynamically "customize" that "link:" paramenter with jQuery. I think the best solution is to use a code like this along with the dashboard page in order to "translate" the shared URLs and see what kind of chocolate people are demanding xD FB.ui({ //declaring a variable (example) var string = getFormData().serialize; var orderString = "mysite.com/dashboard.html?" + string; // end the variables // start facebook API code method: 'send', //or whatever to: 'MyUserID', link: orderString, }); I was working here until I gave up and started to post this http://jsfiddle.net/Frondor/sctepn06/2/ Thanks in advance, I'll love you for ever if you help me solving this :D

    Read the article

  • iPhone SDK 3.2 beta and iPhone SDK 3.1.2

    - by pratik
    Hello, Currently I am using iPhone SDK 3.1.2 for developing iPhone apps. Apple has recently released iPhone SDK 3.2 beta and I want to try my hands with it. But my problem is that I want to use both versions of SDKs, 3.1.2 since I am currently developing apps and uploading on app store, 3.2 beta to start trying the new version (but Apple will not accept apps on App Store, if developed using 3.2 beta) Please guide me. Regards, Pratik

    Read the article

  • php extension COM_DOTNET.dll

    - by aXul
    I'm trying to add a PHP extension (PHP_COM_DOTNET)to my server, by writing the following in my php.ini [COM_DOT_NET] extension=php_com_dotnet.dll I downloaded the dll file and put it in my ext folder, but when restarting the server, I got the following errors cant find entry point zend_new_interned_string in php5ts.dll php startup: unable to load dynamic library php_com_dotnet.dll couldn't find especified process I'm using php 5.3.18 on a xampp-like package (vertrigoserv)

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >