![]() |
|
|
| Subject:
Php coding question
Category: Computers > Programming Asked by: thisquestion-ga List Price: $35.00 |
Posted:
02 Jun 2006 07:40 PDT
Expires: 02 Jul 2006 07:40 PDT Question ID: 734727 |
I need a piece of php code that will solve the following task. Please test the php code to make sure it works. Task: Please look at this URL http://www.prosper.com/public/lend/listing.aspx?listingID=16145 The following php code successfully writes the source code of this page into the variable $htmldata: $listing = 16145; $srcurl = 'http://www.prosper.com/public/lend/listing.aspx?listingID=' . $listing; $htmldata = file_get_contents ("$srcurl"); But now look at the link at the bottom right of the page saying "Next" which allows to open the next page with follwoing bids (51-100). I need php code that will get me these subsequent listing bids pages into the string $htmldata. Naturally it should work for any listing number. $listing=16145; is only an example. |
|
| Subject:
Re: Php coding question
Answered By: tox-ga on 04 Jun 2006 04:18 PDT Rated: ![]() |
thisquestion-ga,
I have placed the requested function in the file:
www.maxlin.ca/get_pages.zip
To use, simply extract the get_pages.php to the directory you want to
use it and add:
<? include ("get_pages.php"); ?>
to the top of your php file.
An example usage of the function would be (ensure the CURL modules in
PHP are enabled):
echo get_pages("http://www.prosper.com/public/lend/listing.aspx?listingID=","16327");
As a side note, you probably want to increase the time-out of the PHP
script since this site is rather slow. To do this, use:
set_time_limit("300");
or some other suitable parameter (300 is in seconds).
Cheers,
tox-ga |
thisquestion-ga
rated this answer:
thx - works as desired |
|
| Subject:
Re: Php coding question
From: seventoes-ga on 03 Jun 2006 22:50 PDT |
if i understand correctly... in php: <?php $listing = $_GET['listing']; $nextListing = $listing+1; $srcurl = 'http://www.prosper.com/public/lend/listing.aspx?listingID=' . $nextListing; $htmldata = file_get_contents($srcurl); |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |