facebook - how can i get a pop up message and redirect to url in php? -


i have looked no answer seems suit needs. once user completes series of forms, need message thanks, confirm update , redirect main page.

code:

<?php    require './facebook.php';  $facebook = new facebook(array(   'appid'  => ' *************',   'secret' => '********************',   'cookie' => true,  ));  $status2 = $_post['status2'];  $uid = $facebook->getuser();  $args = array(     'message'   => $_post['status2'],     'link'      => 'http://apps.facebook.com/geordie-status/',     'caption'   => 'translate english geordie' );  if(isset($_post['post']))   $post_id = $facebook->api("/$uid/feed", "post", $args);      $msg = "thanks translating status, has been posted wall.";      header("location: http://apps.facebook.com/geordie-status/");   ?> 

when button clicked, update posted, there no message box or redirect, doing wrong?

you should make sure aren't sending before call header(). if have whitespace before code called, or html, header() not work. if environment meets requirements header_register_callback recommend give try well.

also, after use header('location'); should call exit or die function prevent else being sent.

if redirect in javascript download page.

'your download begin momentarily. if download not start click here.'

'your status has been updated, redirected momentarily. click here return home.'

javascript's window.location , settimeout() satisfy requirements.

settimeout('redirect',15000);  function redirect(){  window.location='http://apps.facebook.com/geordie-status/' } 

if want use hard message box should use confirm() yes/no or alert() message. alternatively, can use jquery popups.

var dialogresult =  confirm("press ok confirm submission"); if (dialogresult == true){    // post status }  else{    // sad , nothing } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -