Chico
Chico

Reputation: 23

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 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.

Upvotes: 0

Views: 250

Answers (3)

Gaurav Gupta
Gaurav Gupta

Reputation: 5416

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

Upvotes: 4

hanno
hanno

Reputation: 6513

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

Upvotes: 2

Tyler Carter
Tyler Carter

Reputation: 61577

You forgot a quote:

$appsecret = '9ad606899a809cad1da38d12fc2101e0; 

into

$appsecret = '9ad606899a809cad1da38d12fc2101e0'; 

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

Upvotes: 1

Related Questions