View Full Version : reading a file for position to save to var

12-03-2008, 11:47 PM
In need of a great deal of help :) What I'm aiming to do is search a webpages source code for a certain ID string, save it to a variable, and submit it to a form elsewhere. I know this would involve finding the strings position of course, but beyond this I really do not have enough experience with PHP to accomplish it. I have been building some utilities for use on our intranet at work and this would make a great deal of difference if I can accomplish it.

For an example say the webpage in question was http://www.realtor.com/search/listingdetail.aspx?mlslid=3026985 or any other get return result for that matter.

what I need to save to a variable and submit as another get name is ' "Id":22249792, ' from <div class="listingData"> the '22249792' being what I need to read, identify and save to a variable. Regardless of if its a 5 digit or 15 digit number, I need anything between :, after "Id".

There are additional "Id"s through out each file, but this is always uniquely the first so I'm thinking establishing that as a constant position would be the starting point here.. again I am not experienced in PHP, not to this point of troubleshooting at least :) all help is greatly appreciated. :confused:

12-04-2008, 07:27 PM
If you google "screenscraping", you will find scripts that do this sort of thing.

12-05-2008, 10:52 PM
thank you, I'll research this a bit :)