The Most Active and Friendliest
Affiliate Marketing Community Online!

“Adavice”/  “1Win

how would I code this in php?

g1siberia

New Member
affiliate
lo all, 1st time here, be gentle :thumbsup:

I am learning php for fun and have set myself a project to write a php script that when run does this:

goes to amazon.co.uk
searches for item you specified eg item number 123456
'finds' the price on the page
copies and pastes the current price to a txt file


the 3rd part, where the code locates the price on the page is probably the trickiest - any suggestions how to go about this?

thanks :kneeled:
 
You will need to read in the source of the page using fopen() and use the strpos() function to find the start of the part you need and the end of the part you need. Then add the data to a text file or even a mysql db.

You will need to keep tabs on the position you have reached in the file so you can read on and find the next price.
 
If you are an Amazon Affiliate, you can access their data through web services and xml apis, it's so easy instead of extracting from the page source..
 
banners
Back