SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to fetch search results from another site?

    HI I am a new bie dont know where to post this topic.
    Actually I want to write a php code which could fetch the flight informations from various airlines sites. These sites have a form in which user can enter information and search the flight. I want to display those results in my site when a user comes to my site and search about flight. For eg. user want to search flights from city-1 to city-2 then he enter the information on my site and my script should search flights according to that information on various airlines sites and display the results with the tag of which ailines is providing this flight.
    Could any one plz suggest how to do it?

  2. #2
    messing with my mind fristi's Avatar
    Join Date
    Feb 2009
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pankajshr_jpr View Post
    HI I am a new bie dont know where to post this topic.
    Actually I want to write a php code which could fetch the flight informations from various airlines sites. These sites have a form in which user can enter information and search the flight. I want to display those results in my site when a user comes to my site and search about flight. For eg. user want to search flights from city-1 to city-2 then he enter the information on my site and my script should search flights according to that information on various airlines sites and display the results with the tag of which ailines is providing this flight.
    Could any one plz suggest how to do it?

    The PHP cUrl functions might be a good start:
    http://php.net/curl

    it's an library written especially to access remote webpages.
    To PHP or to Perl, that is the question!
    (Bucket - simpletest) User

  3. #3
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fristi View Post
    The PHP cUrl functions might be a good start:


    it's an library written especially to access remote webpages.
    Thank you but I think cUrl used to connect with the another website host. How could i pass the information entered by user in a form to search a flight to another website and fetch that search result to my site?

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even I am also not sure about this,but how about taking all the data in XML format and then display the result on your site.

    Noddy

  5. #5
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vaibhavcoder View Post
    Even I am also not sure about this,but how about taking all the data in XML format and then display the result on your site.

    Noddy
    That cud be the easiest solution but the remote site may not provide data in XML format or as the feeds.

  6. #6
    messing with my mind fristi's Avatar
    Join Date
    Feb 2009
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pankajshr_jpr View Post
    Thank you but I think cUrl used to connect with the another website host. How could i pass the information entered by user in a form to search a flight to another website and fetch that search result to my site?
    And it is not possible to send the search parameters through url?

    example:

    www.airline.com/?destination=moon&date=june

    then through cUrl you can fetch the results. Although I'm not sure if all airlines support that kind of parameter sending.
    To PHP or to Perl, that is the question!
    (Bucket - simpletest) User

  7. #7
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fristi View Post
    And it is not possible to send the search parameters through url?

    then through cUrl you can fetch the results. Although I'm not sure if all airlines support that kind of parameter sending.
    Not all sites supports this feature. Many of the sites uses POST method or even javascript to process the search results i.e. the URL doesn't changes while searching.

    Can I query the file which is being called by form used by flight sites during searching by using POST/GET or call the functions used by flight sites for searching by any means??
    Then it would be very easy as i would call the function directly and fetch the results.


Tags for this Thread

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
  •