Jump to content


Photo

[SOLVED] Go to Url and take some info


  • Please log in to reply
2 replies to this topic

#1 mr_zhang

mr_zhang
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 02 September 2006 - 06:20 AM

Hi guys,

I'm new to this forum. I've tried to search but can't seem to get the answer. So, I'm posting this.

I have 2 web servers on 2 domains. Let's say server A and B. Server A has database and a kind of search the db function. Server B doesn't have it. However, I want to create a script on server B that ables to:
- go to server A.
- Run a search
- Get only partial data from the result form.

I don't want server B to have a function to access DB at server A as I'm going to share the script to several people. I don't want them to have full search result.

To make it easier for you to understand. Let's pretend that I want to get data from Google. I don't have access to Google's DB but I can search and get, e.g., the total number of websites (it's the xxx of the "1 to 10 of xxx"). How can I get the number?

What I can't do are:
- Go to a certain url while still being on my server. So it's not like header go to. I guess.
- Put some string on the search box and simulate the pressing of the "search" button.
- Get the data. Do I have to manually search character by character or is there any faster method?

I'm hoping somebody could give me example how to take the xxx of the "1 to 10 of xxx" from Google. Then put the number on the same page at my server. From there I guess I can do the rest with my own server.

Thank you.

#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 02 September 2006 - 07:52 AM

You should be looking into cURL.

You can find some tutorials in this topic:
http://www.phpfreaks....msg422079.html

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 mr_zhang

mr_zhang
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 03 September 2006 - 04:53 AM

Thanks Orio.

It's just what I need. :)

I guess it also enables me to do POST action. I'll try it.
It seems that I can only manually edit the strings character by character huh.

Thanks again.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users