Link to home
Start Free TrialLog in
Avatar of lawrence_dev
lawrence_dev

asked on

Need assistance with loop (to go t next page)

Experts,

My script works perfect.  However, I cannot go to the next page.  How do I correctly configure a loop?

There are generally about 40 to 60 open orders at any given time in increments of 25.

For example:
$url_2 = 'http://www.***electronics.com/b2b/openorders.php?search=&searchType=&start=0';
$url_2 = 'http://www.***electronics.com/b2b/openorders.php?search=&searchType=&start=25';
$url_2 = 'http://www.***electronics.com/b2b/openorders.php?search=&searchType=&start=50';
$url_2 = 'http://www.***electronics.com/b2b/openorders.php?search=&searchType=&start=75';


//NEED LOOP HERE (Increments of 25 - start=0, 25, 50 etc)

$url_2 = 'http://www.***electronics.com/b2b/openorders.php?search=&searchType=&start=0';//new url
	curl_setopt($ch, CURLOPT_URL,$url_2); // set url to go fetch
	curl_setopt($ch, CURLOPT_AUTOREFERER, true);
	curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
	curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
	$buffer2 = curl_exec($ch); // run the process
	//echo $buffer2;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial