inserting information from another website using php?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Garfunkiel
Forum Newbie
Posts: 1
Joined: Wed Mar 16, 2005 4:11 pm

inserting information from another website using php?

Post by Garfunkiel »

Ok, here's what I want to do:
1) Open a webpage (it's a .cgi, if that matters)
2) Find a spot in the code and copy the number at that point.
3) Paste the number into the open page.

How would I do that? I found out that I should use ereg_replace() to do so, but how do I open the page, copy a specific spot, and paste that into the open page? Please help.
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

you should try reading this : http://us2.php.net/file
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

file_get_contents() may be a better choice. Also, ereg_* functions are slowish, compared to preg_*. I'd suggest using preg_match() or its sibling preg_match_all()
Post Reply