Facebook Application using PHP on server problem
I'm trying to wrtie a facebook application that generates random quotes using php. However, I'm getting this error and I don't know how to sort it.
Parse error: syntax err开发者_运维知识库or, unexpected T_STRING in /home/a9607557/public_html/index.php on line 8
This is the code I have:
<?php require_once 'includes/facebook.php';
$appapikey = '<Hash>';
$appsecret = '<Hash>;
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
$callbackurl = 'http://newuser.hostei.com/';
//initialize an array of quotes $quotes= array("Hello World.", "Yes", "New");
//Select a Random one. $i= rand(0, sizeof($quotes)-1);
I'm sure the problem must be lying in these lines of code. Thanks for any help.
Now that you've given away your application keys, you should regenerate them soon unless you want your app hacked.
There's a missing ' at the end of the $appsecret line.
You forgot a quote:
$appsecret = '9ad606899a809cad1da38d12fc2101e0;
into
$appsecret = '9ad606899a809cad1da38d12fc2101e0';
May I suggest using an IDE that is good at detecting those problems. Like Netbeans?
精彩评论