Posts

How to separate url into a embed code of youtube?

how to separate url from a embed code of youtube ? there is a solution for Get url into a  embed code of youtube function getyoutubeVideolink ($code){     $a = array();     $b = array();     $c = array();     $a = explode('src',$code);     $b = explode('frameborder',$a[1]);     $b = explode('frameborder',$b[0]);     $c = explode('"',$b[0]);     return $c[1];     } $embed_code = '<iframe width="420" height="315" src="http://www.youtube.com/embed/GwQMnpUsj8I" frameborder="0" allowfullscreen></iframe>'; $url = getyoutubeVideolink( $embed_code ); echo $url; Now you can use this url in a iframe and where do you want

response.session.access_token is not working during the facebook connect?

JavaScript SDK and OAuth 2.0 Roadmap Facebook has updated JavaScript SDK and OAuth 2.0 Roadmap Due to this reason response.session.access_token is not working So You have make some changes in your Facebook login Function   FB.login(function(response) {                 if(response.session) {                     var access_token = response.session.access_token;                     FB.api('/me', function(response) {                     }                 } }   Your code was like this in facebook login function.   So edit some code and make this problem solved    FB.login(function(response) {                     if (response.authResponse) {                     var accessToken = response.authResponse.accessToken;                     alert(accessToken);                     FB.api('/me', function(response) {                     }                 } } So you have to change response.session to response.authResponse and  access_token to accessToken Done

How to print a response object comes by facebook login in javascript or jquery?

Facebook response return an object So for print the response You can use JSON . stringify () function. You can use this function as mention below alert( JSON . stringify (response)); Example : FB.login(function( response ) {                     FB.api('/me', function( response ) {                   var query = FB.Data.query('select src_big from photo where pid in (select cover_pid from album where owner={0} and name="Profile Pictures")', response.id);                  query.wait(function(rows) {                          alert(JSON.stringify(response));                                });                    }); }

How to add jquery vertical left panel slider?

Image
Many people says that they want a good left panel and they want that when they select any menu then submenu should be open in slow motion vertically. So here is the code of left panel slider with jquery and css with some screen shot. You can also edit them according to you need. On the first view left panel will look like this If you move your cursor on it than look like this If you click any option then it opens the submenu like this Here is the code simply copy and paste this code in your page and run // Code start from here <style> body {     font-family: Helvetica,Arial,sans-serif;     font-size: 0.9em; } p {     line-height: 1.5em; } ul#menu, ul#menu ul {     list-style-type: none;     margin: 0;     padding: 0;     width: 18em; } ul#menu a {     display: block;     text-decoration: none; } ul#menu li {     margin-top: 1px; } ul#menu li a {     background: none repeat scroll 0 0 #F5ECF5;     border: 1px solid #D7C2D7;

How to use facebook api for login Or register on our website?

<!--facebook login--> add latest jquery file on the top of the file <div id="fb-root"></div> <script type="text/javascript">             window.fbAsyncInit = function() {                 FB.init({appId: 'your api id', status: true, cookie: true, xfbml: true});                 /* All the events registered */                 FB.Event.subscribe('auth.login');                 FB.Event.subscribe('auth.logout');                               };                              (function() {                 var e = document.createElement('script');                 e.type = 'text/javascript';                 e.src = document.location.protocol +                     '//connect.facebook.net/en_US/all.js';                 e.async = true;                 document.getElementById('fb-root').appendChild(e);             }());                         function customFbLogin

How to create or add cookie value by javascript?

<script type="text/javascript"> function setCookie(c_name,value,exdays) { var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString()); document.cookie=c_name + "=" + c_value; } call this function to create cookie  like below setCookie("cookie_name",value,365); if you dont want delete a cookie after a several time then place 0 zero on exdays(356) </script>

Uncaught exception in Google authentication in apiOAuth2.php and apiOAuth2->setAccessToken('{? "access_tok...') error

In this google+ api there is main poblem when ever you use api code it shows some uncaught error. like : apiOAuth2->setAccessToken('{? "access_tok...') Or Fatal error : Uncaught exception 'apiAuthException' with message 'Invalid token format' in /home/project/public_html/gplus/src/auth/apiOAuth2.php:109 Stack trace: #0 /home/project/public_html/gplus/src/auth/apiOAuth2.php(74): apiOAuth2->setAccessToken('{? "access_tok...') #1 /home/project/public_html/gplus/src/apiClient.php(130): apiOAuth2->authenticate(Array) #2 /home/project/public_html/gplus/gplus_login.php(15): apiClient->authenticate() #3 /home/project/public_html/gplus/index.php(9): include('/home/project/...') #4 {main} thrown in /home/project/public_html/gplus/src/auth/apiOAuth2.php on line 109 and it will not work on localhost in ..src/auth/apiOAuth2.php file you have the code $accessToken = json_decode($accessToken, true); if (! isset($acces