Author Topic: Question about HTML/PHP/MySQL.  (Read 275 times)

boxerorange

  • Posts: 75
Question about HTML/PHP/MySQL.
« on: May 20, 2009, 06:27:00 pm »
Alright, so I want to copy information from one website onto mine.
I don't know how to do this, but I think the easiest way to do this would be to copy the data into a MySQL database, but how to do this I am unsure of.

So if anybody knows of a different/better way to do this, please post it. Or if you know how to do what I'm asking, post that as well.

Thanks!

Your Eliteness

  • Posts: 1639
    • GE
    • PD
    • 2020RankingsDev
Question about HTML/PHP/MySQL.
« Reply #1 on: May 22, 2009, 10:58:00 am »
Is this other website controlled by you? Do you have access to its database? I'll assume not.

You can use file_get_contents() to get their HTML source, then use preg_match_all() to filter the data you need. If their page needs something a bit more advanced such as a cookie or POST data then you'll probably need to use the curl functions to request it instead of file_get_contents().

http://php.net/file_get_contents
http://php.net/preg_match_all
http://php.net/curl

boxerorange

  • Posts: 75
Question about HTML/PHP/MySQL.
« Reply #2 on: May 22, 2009, 01:16:00 pm »
Wow. That's exactly what I'm looking for, but getting it to work how I want will probably be harder. I'm just glad it's not a page that has cookies or anything.

I'm looking at doing something similar to http://www.250films.net, so my problem now would be getting the information to update...UNLESS, I can put a this script on a page and then just run that (by visiting the page) whenever I feel like it.