Jump to content

PHP/MySQL Coding for Facebook


Doctor Cuts

Recommended Posts

Newbie Disclaimer: I am a first-time programmer using PHP, MySQL, and several of the modified markup languages implemented in Facebook's platform.

 

I am in the process of developing a Facebook gift application for my company, which designs fashion accessories. My own PHP coding is going fine thus far, but I am having trouble implementing the functions provided in Facebook's API library.

 

To begin, I'll give you an overview of the app. I assume many of you are familiar with FB gift apps. Like any other gift app, mine is meant to allow users to select an item and send it to a friend (i.e., display it on the recipient's profile). Additionally, for each gift the company will make a small donation to one of three charities, so I've added some donation counters and such (more about that later).

 

So I created the overall interface, with a screen to select a charity, another for selecting a corresponding item, and another for confirming that a gift was sent. There are also pages for viewing sent and received gifts and for inviting friends to use the application.

 

Using just my own code, I could get all the pages to display as expected. But as soon as I began to plug in the functions provided in Facebook's client library (which can be found here: http://developers.facebook.com/clientli ... orm.tar.gz), the page simply stopped loading.

 

Here is a version of the app that (virtually) works: http://apps.new.facebook.com/ponogifts/charity_sel.php

 

And here's what happens when I plug in Facebook's client functions: http://apps.new.facebook.com/ponogifts/ ... faulty.php

 

And here's an archive containing all of the code for this project: http://www.ponobyjoangoodman.com/facebook/PONO_app.zip (This archive is also attached to this thread. And please forgive me, I haven't exactly mastered the art of refactoring)

 

When I make a coding error, the Facebook server renders the usual error screens, but as soon as I fix those errors the page goes back to its old habit of not responding. According to FB, it's my host server, not theirs, that stops responding... but this doesn't seem quite correct, as the application actions are being logged in a MySQL database on my hosting server. So on my end, everything seems to be in working order, but my scripts won't execute on Facebook's site.

 

Also, there's a much less important issue that I'd like to raise. On the view page (http://apps.new.facebook.com/ponogifts/view.php) I can't get my donation counters to round to two decimal places, so as to display a dollar amount.

 

So if anyone has any thoughts on these matters, your input would be greatly appreciated.

 

Also, since I'm sure no one wants to scour this project line by line, I'll specify the specific functions and code lines I'm having trouble with. In send.php (A.K.A. send_faulty.php in the archive) I'm having trouble at lines 116-117. In PONO.class.php I'm having trouble with the update_profile function, which references Facebook's profile_setFBML function, which in turn can be found in Facebook's client archive in the facebookapi_php5_restlib.php file. Hopefully this will help anyone willing to take a look at this stuff to locate the problem spots quickly.

 

Thanks,

Eric

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/120422-phpmysql-coding-for-facebook/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.