php - having an issue with invite friends dialog with facebook -


i have button if statement, , idea when button pressed, facebook multi friends invite dialog shows up.

i did have showing when main canvas loaded, needed when button clicked, , when click button refreshes background.

here statement:

<?php if(isset($_post['invite'])) { ?> <div id="fb-root"></div>" <script src="http://connect.facebook.net/en_us/all.js"></script> <script> fb.init({          appid:'161051054059696',      cookie:true,          status:true,      xfbml:true       });       fb.ui({ method: 'apprequests',          message: 'share geordie wall post mates!'});   </script> <?php } ?> 

instead of closing , opening php tags tried using echo wasn't successful either. think if statement looks should work, not.

hopefully can help.

my edited code:

<div align="center"> <form method="post"> <input type="image" name="invite" src="images/invite.png"   onclick="invitefriend();"> </form> <?php if(isset($_post['invite'])) { ?> <div id="fb-root"></div>" <script src="http://connect.facebook.net/en_us/all.js"></script> <script> fb.init({      appid:'161051054059696',  cookie:true,      status:true,  xfbml:true   });  function invitefriend(){      fb.ui({ method: 'apprequests',          message: 'share geordie wall post mates!'}); } </script>  <?php } ?> 

i realized in original code, didn't include button code. have own image use button if makes difference.

the php server side. when user click in button, php side, doesnt exist anymore.

you have create javascript funcion.

function invitefriend(){     fb.ui({ method: 'apprequests',          message: 'share geordie wall post mates!'}); } 

and associate button click function.

<input type="button" onclick="invitefriend();" value="invite" /> 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -