Page 1 of 1

inserting information from another website using php?

Posted: Wed Mar 16, 2005 4:16 pm
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.

Posted: Wed Mar 16, 2005 4:22 pm
by infolock
you should try reading this : http://us2.php.net/file

Posted: Wed Mar 16, 2005 4:30 pm
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()