Hi,
This is my problem:
I have a web server which runs with a PHP script on it. This script is used to search a database for a given number. I want to write another script which has a form inside it, and users can search for multiple numbers.
I mean there are several text boxes in it and the user enters numbers, my script should send this numbers to the search script one by one and collect the resulting pages. I donot have access to the PHP search script source, because it has been written by a company which refuses to give me the source.
How can I do it? Can you help?
Search using PHP
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Are you sure you have authorization to scrape data from that server?
What you will probably have to do is scrape the pages yourself using CURL, parse out the data, and serve them back to user. If they have an XML-RPC or SOAP interface, it makes things a bit easier, but either way it will be sloooow.
What you will probably have to do is scrape the pages yourself using CURL, parse out the data, and serve them back to user. If they have an XML-RPC or SOAP interface, it makes things a bit easier, but either way it will be sloooow.
Ok, i think i know what you mean. First, it would be good to know what kind of interface you have w/ the remote script. Do you give it a number by including the script, then using a function, or by POST/GET, SOAP, etc? If you send it numbers by GET, i think a good way to start would be something like:
that is, assuming textboxes are:
I don't do much with SOAP, so i wouldn't know what to do in that case.
Another option is client-side AJAX, making a single new request for each number in the field.
Hope I could help!
Code: Select all
foreach($_GET['numberboxes'] as $number){
echo include("http://wherever.com/script.php?num=$number");
echo "<hr>";
}Code: Select all
<input type='text' name="numberboxes['num1']" />Another option is client-side AJAX, making a single new request for each number in the field.
Hope I could help!