1

The title of this question doesn't explain clearly what I'm looking for, but my question below does. So please read and if possible give me a better solution.

What I'm Developing: I'm developing an IMS (Inquiry Management System) application using Codeignitor.

What exactly IMS does: It collects user submitted data from different website and displays it on the IMS personalized account system.

Where I'm stuck: There are so many method to collect data from an other server, it can be a direct post method to the IMS server or the IMS reads json/xml based data from the source server to fetch data etc. But my question here is how can i get 100% data from the source without loosing any user submits?

100% what i mean is...

Like: If I'm using a direct post method to collect data from source server:-

*What if the IMS server is down when the user submitting the data from source server?

Like: If I'm using json or XML method to fetch data from the source server:-

*I might have to create db on each server for this to work, so an API based solution will be a complete flop.

I hope my question is clear.

Please let me know what is the alternative and best solution for the above mentioned scenario.

Regards Fahid

Fahid Mohammad
  • 910
  • 3
  • 17
  • 47

4 Answers4

1

You can use curl to scrape data from websites. You may also need a domparser to read the content

Example What is cURL in PHP?

Community
  • 1
  • 1
andrew
  • 9,313
  • 7
  • 30
  • 61
0

if you already know what urls you are using to get the data from, could you use a database on the application side to store urls and relate what method to use to retrieve the data? that way you can create a model and each method would be its own function. example $this->model->xml() or $this->model->post etc.

DevNinjaJeremy
  • 138
  • 1
  • 6
0

use API's to fetch data from another server with using urls.

jiten
  • 1
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 29 '22 at 10:24
0
// From URL to get webpage contents.
$url = "https://www.wel.org/";
 
// Initialize a CURL session.
$ch = curl_init();
 
// Return Page contents.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
//grab URL and pass it to the variable.
curl_setopt($ch, CURLOPT_URL, $url);
 
$result = curl_exec($ch);
 
echo $result;
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
jiten
  • 1
  • 1