tags:

views:

47

answers:

3

Hi, 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 error, 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.

+1  A: 

You forgot a quote:

$appsecret = '9ad606899a809cad1da38d12fc2101e0; 

into

$appsecret = '9ad606899a809cad1da38d12fc2101e0'; 

May I suggest using an IDE that is good at detecting those problems. Like Netbeans?

Chacha102
Thanks but it is now giving me a different error FBML Error (line 8): illegal tag "body" under "fb:canvas":S not sure if this is from facebook, and if so how to change it
Chico
Your app is a FBML app, so it is already inside a body tag. Just imagine your app lives inside a big div. No head tag, body tag, and html tags allowed.
alex
+2  A: 

There's a missing ' at the end of the $appsecret line.

hanno
+4  A: 

Now that you've given away your application keys, you should regenerate them soon unless you want your app hacked.

Gaurav Gupta