SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Feb 2010
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is it Possible in PHP? Need Help..

    Hi All

    I need ur help. Is it possible to fetch the information from other sites and store those information in to my database for my site viewing purpose? Periodically i have to update the info from other site into my database. Updated database will be shown on my site. I don't know whether it is possible or not. If means please let me know how to retrieve the information from other site?

    Thanks in advance

    Regards,
    Vanash

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First of all, you are authorized person to retrieve the information from others' site. If you are authorized then you must know what type of information is existed and how in that site. So depending upon the format of the information i.e. XML, HMTL or normal text or something other, you can use different methods/functions in PHP. So in general, yes indeed it is possible to retrieve the information from other sites. If you want to grab all the HTML from others' site then you can easily use file_get_contents() function to return as a string. Otherwise, fsockopen, curl, dom, etc. could be the other alternatives.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  3. #3
    SitePoint Member
    Join Date
    Feb 2010
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rajug View Post
    First of all, you are authorized person to retrieve the information from others' site. If you are authorized then you must know what type of information is existed and how in that site. So depending upon the format of the information i.e. XML, HMTL or normal text or something other, you can use different methods/functions in PHP. So in general, yes indeed it is possible to retrieve the information from other sites. If you want to grab all the HTML from others' site then you can easily use file_get_contents() function to return as a string. Otherwise, fsockopen, curl, dom, etc. could be the other alternatives.
    Thanku Mr.Rajug,

    I want to develop a site that includes info about flight details. For example, Flight cost - it may vary depends on the company. I have to update each time if the company changes their flight cost. If i have more than 1000 of flight details, it seems to be difficult changing(updating) cost each and every-time(manually). So i need it to be automated.

    Automated in the sense, I have to update my database by retrieving the costs from other sites. Not only cost and also other details.

    Although im not authorized persons to retrieve the data. Just want to extract the content(cost & other details) of the website.

    Now tell me, is it possible?

    Thanks and Regards,
    Vanash

  4. #4
    SitePoint Zealot
    Join Date
    Jan 2006
    Location
    Gold Coast, Australia
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  5. #5
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Vanash View Post
    Thanku Mr.Rajug,

    I want to develop a site that includes info about flight details. For example, Flight cost - it may vary depends on the company. I have to update each time if the company changes their flight cost. If i have more than 1000 of flight details, it seems to be difficult changing(updating) cost each and every-time(manually). So i need it to be automated.

    Automated in the sense, I have to update my database by retrieving the costs from other sites. Not only cost and also other details.

    Although im not authorized persons to retrieve the data. Just want to extract the content(cost & other details) of the website.

    Now tell me, is it possible?

    Thanks and Regards,
    Vanash
    Yes it is still possible but as I said before you have to know the format of the content. You want to grab that from a website? Do you know how they have rendered the information in their site? At least show us the HTML so that i can help you ahead. Otherwise ask them (the site owners) to provide you an API or XML or anything if they have for easy access.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


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
  •