Results 1 to 5 of 5

Thread: PHP request information

  1. #1
    Join Date
    Jul 2010
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default PHP request information

    Hey guys,
    before anything, im somewhat of a newbie to PHP, but i have a decent grasp on the basics.

    Im wondering about a script that requests information from a database/server.
    I dont mean information like IP, time, domain, etc... Im referring to information stored in the database its self.

    for example, we'll take facebook since its soo popular... A script that requests information about my account, like history of apps added/removed, last login time/date, friends/apps removed, etc... Just basic information about my account history and usage.

    From a "legal" point of view, I dont see this as any privacy/security breach..but i may be missing some bigger picture. So if anyone sees some legal issues with this request, please feel free to mention it.

    Thanx in advance for any information and help.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'm not certain what you are asking. PHP is designed to work with databases, but these databases are usually part of the site. If you want to work with an external database, that will be difficult because that means you can't actually work with the database-- you'll need to access it indirectly.
    To interact with facebook, the facebook website must first allow some method for you to request information then you must use PHP to do this-- but only if they allow a method.

    Additionally, if you are talking about external user accounts, this requires that you have the user's password, which generally will cause some problems or at least make users a little uncertain about your site.


    Legally, this all depends on what is allowed on the other site. If you do any sort of "hacking" that's obviously a problem, but in general if you can access it, it's probably allowed-- unless, of course, they have some rule in their TOS that says 3rd party sites cannot access their information. Then you're effectively stealing.


    The situation is of course entirely different if you manage both sites or have specific permission from the other site and can work with its owners or ask for help in interacting.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jul 2010
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    yes it would be external. using the facebook example, it wouldnt be other users accounts, so no password needed. it would be my own account.

    Also, the site im requesting information from "facebook" would have all the details available, im just looking for a script that would request those details from a outside domain.

    So what you said, that facebook must "allow" a method, would that be the only obstacle?

    I remember afew years ago, there was a game called WarBook, on facebook, and someone developed a PHP script on a outside server, which displays a "player's" detailed statistics: army size, army configuration, gold amount, etc.. all you needed to do is insert the user's screen name.

    Im looking for something similar, but in this example, I would be requesting a history log of my account usage.
    I guess in a way like the News Feed on the facebook site, tho more detailed.

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You would still need your password, at least. You could store this directly on your server in the PHP code, though, and that would be mostly secure (unless your server was hacked or someone was able to monitor your server's connection to "facebook").

    "Only obstacle"... yes. And making it function on your site. Generally speaking, the only way to access another server is to request a page, just like you would yourself in your browser: so you could program your server to log on, then parse the entire page and extract information. This is how a search engine works. However, it is also a lot of data and very hard to extract the right information.

    Aside from that, you will need what is called an "API", an application programming interface. An API is designed to allow external programs/sites request/submit certain information that will work with the server. Some sites have this and others do not. They also have limited functionality, based on what is allowed by the website.

    I know that facebook has an API called "facebook connect". I've never used it, but if you look up "facebook connect API PHP" on a search engine, I'm sure you'll find all the information you need.

    It may still not be "easy", but it will be possible.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Jul 2010
    Posts
    27
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    ahhh.. that makes sense.
    I'll have a search on the Facebook Connect API, see where i can go from there, and learn more about API. I never used anything of the sort, like i said, im abit of a script kiddie.

    Thanx alot for your help, your explanations were great!
    Hope if i come back you'll offer more help.

    Wish me luck!! im gonna need it i think. lol

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •