Subscribe to Demo - Revolution CitySkype callSubscribe to Demo - Revolution CityAsk question

Subscribe to Demo - Revolution City Subscribe to Demo - Revolution City

Facebook App

Wednesday, April 20, 2011 by S/W Development & SEO


require 'facebook.php' ;


$facebook = new Facebook(array(
'appId' => ' ',
'secret'=>' ',
'cookie'=> true,
));
$session =$facebook->getSession();
if (!empty($session))
{
try
{
$uid = $facebook->getUser();
$user = $facebook->api('/me');

} catch (Exception $e){}
if (!empty($user))
{
if ($_GET['installed']=='1')
{
header("Location: http://apps.facebook.com/-----------");

}
echo "hello";
}
else
die("an error Occured.");
}
else
{
$url = $facebook->getLoginUrl();
echo"click here to php acdemy";
}
?>



index.php Canvas URL site url
---------
require 'facebook.php';

$facebook=new Facebook(array(
'appId' => '144061355653368',
'secret' =>'c8e80315fd221060bd964d0bfcdb6e4c',
'cookie' => true,
));

$session = $facebook->getSession();


if (!empty($session))
{
try
{
$uid = $facebook->getUser();
$user = $facebook->api('/me');

} catch (Exception $e){}
if (!empty($user))
{
if ($_GET['installed']=='1')
{
header("Location:http://apps.facebook.com/muthukkumaran/");
}
echo "hello" .$user['first_name']." ".$user['last_name'];
}
else
die("Error.");
}
else
{
$url = $facebook->getLoginUrl();
echo"Conect With FaceBook Deft Infosystems Pvt.Ltd";
}




?>



Fan page email

$errors = '';
$myemail = 'mkumaran@deft.in';//<-----Put Your email address here.
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['message']))
{
$errors .= "\n Error: all fields are required";
}

$name = $_POST['name'];
$email_address = $_POST['email'];
$message = $_POST['message'];

if (!eregi(
"^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",
$email_address))
{
$errors .= "\n Error: Invalid email address";
}

if( empty($errors))
{
$to = $myemail;
$email_subject = "Contact form submission: $name";
$email_body = "You have received a new message. ".
" Here are the details:\n Name: $name \n Email: $email_address \n Message \n $message";
$headers = "From: $myemail";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
//redirect to the 'thank you' page
header('Location: contact-form-thank-you.html');
}
?>
Contact form handler

echo nl2br($errors);
?>


E-mail-to trials


Contact form handler





index.php example of tutorials

'144061355653368',
'secret' =>'c8e80315fd221060bd964d0bfcdb6e4c',
'cookie' => true,
));

$session = $facebook->getSession();


if (!empty($session))
{
try
{
$uid = $facebook->getUser();
$user = $facebook->api('/me');

} catch (Exception $e){}
if (!empty($user))
{
if ($_GET['installed']=='1')
{
header("Location:http://apps.facebook.com/muthukkumaran/");

}
echo "hello" .$user['first_name']." ".$user['last_name'];
}
else
die("Error.");
}
else
{
$url = $facebook->getLoginUrl();

echo"Conect With FaceBook Deft Infosystems Pvt.Ltd";
}




?>




Muthukkumaran









}
echo "hello" .$user['first_name']." ".$user['last_name'];
}
else
die("Error.");
}
else
{
$url = $facebook->getLoginUrl();

echo"Conect With FaceBook Deft Infosystems Pvt.Ltd";
}




?>




Muthukkumaran










Home

Services

Locations
























0 comments on "Facebook App"

Hyper Smash