Changing php code with curl login and more curls in loop

W Toku Opublikowano Mar 8, 2015 Płatność przy odbiorze
W Toku Płatność przy odbiorze

This code I have in php logs into a site and then has a loop with another curl inside it. This changes the url each loop. Unfortunately it only does 24 loops and then I get an internal error code 500 after exactly 120 seconds. I'd like it to get more loops in and wondered if it could be changed to do so. I can post the code if possible.

<?php

$id=755303; // this is a unique number that helps to make up the url
$maxnumber = 23; // number of loops or web pages to look at
$count=1; // a way to count how many loops completed

$url = "??????"; // removed for now
$username="??????????"; // removed for now
$password = "????????"; // removed for now
$data_to_send = "username=".$username."&password=".$password;


$cookie_jar = tempnam('/tmp','cookie');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, $data_to_send);
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie_jar );
curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie_jar );
$output = curl_exec($ch);

while($count <= $maxnumber) {
$url="?????????????????????????????".$id."/"; // removed for now
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
$output = curl_exec($ch);

$find = strpos($html, "some text to find ");
$trim = substr($html,$find+18, 4);
echo $trim;

echo "</br>";
$count++;
$id++;

}
?>

PHP Architektura oprogramowania

Numer ID Projektu: #7268701

O projekcie

3 ofert Zdalny projekt Aktywny Mar 8, 2015

3 freelancerów złożyło ofertę za £18 w tym projekcie

tosaiful99

Hi, Thanks for your job post and i interested in your project .I`m professionally web developer and my work experience 3 years.I`m expert in PHP ,HTML5,Website Design,Css ETC. You want to make email list in your Mage Więcej

£18 GBP w ciągu 1 dnia
(0 Oceny)
0.0
sharmishthapal1

I only bid those projects on which i can give my best. I appreciate the uniqueness and individuality of your requirements. My core strength is my vast experience and expertise in planning, designing, implementing and s Więcej

£18 GBP w ciągu 1 dnia
(0 Oceny)
0.0
rakeshmmk

I can help you with php curl. This looks very much doable. Can you share the script? Let me have a look at it and then comment. feel free to ping me

£19 GBP w ciągu 1 dnia
(1 Ocena)
0.0