i have made a facebook app, i want the user to be redirected automatically after filling a form
but it doesnt really redirect to user facebook home instead it will show a facebook link there on the app.
<?php
print "Records added to the database";
sleep(10);//seconds to wait..
header("Location:http://www.facebook.com"); ?>
this is how i am doing facebook connect its workin,
require 'facebook.php';
$facebook = new Facebook(array(
'appId' => 'YOUR_APP_ID',
'secret' => 'YOUR_APP_SECRET',
));
// Get User ID
$user = $facebook->getUser();
if ($user) {
try {
// Get the user profile data you have permission to view
$user_profile = $facebook->api('/me');
echo "<pre>";
print_r($user_profile);
echo "</pre>";
} catch (FacebookApiException $e) {
$user = null;
}
} else {
die('<script>top.location.href="'.$facebook->getLoginUrl().'";</script>');
}
tried this
the put http:// in the link and it did redirect it,
still couldnt find a way to do a delayed redirect, tried alot of javascripts but in facebook, it wont work i guess due to iframes. only the above statement is working without any delay