Jump to content
php.lv forumi

kapec gan ne

Reģistrētie lietotāji
  • Content Count

    42
  • Joined

  • Last visited

About kapec gan ne

  • Rank
    Māceklis

Profile Information

  • Gender
    Male
  1. ko jus iegustat, kad izmantojat servakus no lv? un tam googleadwords 80usd cuponam vertiba ka saldejumam rimi -_-
  2. 49wpm ar 1-3 kludam ar laptopa klavu :} baigi daudz reizes kludos uz to oil ...
  3. $file = '0.txt'; $ch = curl_init(); curl_setopt ($ch, CURLOPT_COOKIEJAR, $file); curl_setopt ($ch, CURLOPT_COOKIEFILE, $file); curl_setopt ($ch, CURLOPT_ENCODING, 'gzip'); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $out = curl_exec ($ch); curl_close($ch); .. vispar tada problema, ka curl neko taja faila neieraksta :{ ieraksta vienkasi atmina vai kur citur un viss
  4. function func1($arr){ $hArr = array(); $results = array(); $count=0; for ($i = 0; $i < count($arr); $i++) { $h = curl_init(); curl_setopt($h,CURLOPT_URL,$arr[$i]); curl_setopt($h,CURLOPT_HEADER,0); curl_setopt($h,CURLOPT_RETURNTRANSFER,1); array_push($hArr,$h); if($count>9 || $i==count($arr)-1){ $mh = curl_multi_init(); print_r($hArr); foreach($hArr as $k => $h){ curl_multi_add_handle($mh,$h); } $running = null; do{ curl_multi_exec($mh,$running); }while($running > 0); //..... foreach($hArr as $k => $h){ curl_multi_remove_handle($mh,$h); } curl_multi_close($mh); $hArr = array(); $count = 0; } $count++; } return $results; } strada ciesami :P
  5. $arr masiva glabajs peimeram 3000 linku vajadzetu partaisit funkciju ta, lai vertu vala tos 3000 linkus pa 10, nevis uzreiz visus :) function func1($arr){ $hArr = array(); $results = array(); foreach($arr as $val){ $h = curl_init(); curl_setopt($h,CURLOPT_URL,$val); curl_setopt($h,CURLOPT_HEADER,0); curl_setopt($h,CURLOPT_RETURNTRANSFER,1); array_push($hArr,$h); } $mh = curl_multi_init(); foreach($hArr as $k => $h) curl_multi_add_handle($mh,$h); $running = null; do{ curl_multi_exec($mh,$running); }while($running > 0); foreach($hArr as $k => $h){ $res = curl_multi_getcontent($h); //.. } foreach($hArr as $k => $h){ curl_multi_remove_handle($mh,$h); } curl_multi_close($mh); return $results; } EDIT: kaut ka apmeram sadi.. neesmu vel parbaudijis function func1($arr){ $hArr = array(); $results = array(); $count=0; for ($i = 0; $i < count($arr); $i++) { $h = curl_init(); curl_setopt($h,CURLOPT_URL,$arr[$i]); curl_setopt($h,CURLOPT_HEADER,0); curl_setopt($h,CURLOPT_RETURNTRANSFER,1); array_push($hArr,$h); if($count>9 || $i==count($arr)-1){ $mh = curl_multi_init(); foreach($hArr as $k => $h) curl_multi_add_handle($mh,$h); $running = null; do{ curl_multi_exec($mh,$running); }while($running > 0); foreach($hArr as $k => $h){ $res = curl_multi_getcontent($h); //.. } foreach($hArr as $k => $h){ curl_multi_remove_handle($mh,$h); } curl_multi_close($mh); $count = 0; } $count++; } return $results; }
  6. noteikti visu manis rakstito neizlasiji un uzrakstiji kaut ko pilnigi nevajadzigu :D
  7. http://jsbin.com/uvowet/ ka iegut id vertibu pie start un update?
  8. ir index.php fails <?php require 'header.php'; echo '<a href="http://site.com">link</a>'; ?> un header.php <?php header('Location: http://site.com'); exit; ?> index - http://localhost/ 1. ja lietotajs atverot lapu tiktu paradresets uz citu lapu no header('Location: http://site.com'); kads bus http_referer (ja bus vispar) 2. kads bus http_referer, ja index fails butu bez ta header.php un lietotajs parietu uz site.com vienkasi pa linku nevaretu ta but ka pirmaja gadijuma referer tiek sutis ka header.php?
  9. Sveiki! piem., no db tiek izvaditi ieraksti () vini tiek kartoti pec lauka sort(int) ka lai izveido tadu listu, lai varetu vienkasi ar drag un drop mainit ierakstu kartibu un saglabat jauno vietu db pec izmainam:)
  10. paldies! primais variants izskatās ka būs īstais :) curl_close pirms return neko nemainija...
  11. sveiki! problēma tāda curl izpildoties ciklā nem vairāk un vairāk ram lidz tas beidzas :{ nepabeidzot to pati funkcija kuru izmantoju ciklā: function grab($url = ''){ if(!$url) return 0; $curl = curl_init(); $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,"; $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; $header[] = "Cache-Control: max-age=0"; $header[] = "Connection: keep-alive"; $header[] = "Keep-Alive: 300"; $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7"; $header[] = "Accept-Language: en-us,en;q=0.5"; $header[] = "Pragma: "; curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1'); curl_setopt($curl, CURLOPT_HTTPHEADER, $header); curl_setopt($curl, CURLOPT_REFERER, false); curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate'); curl_setopt($curl, CURLOPT_AUTOREFERER, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_TIMEOUT, 300); ob_start(); return curl_exec ($curl); ob_end_clean(); curl_close ($curl); unset($curl); } kapec curl neatbrivo atminu? stav memory_limit -1 un izmanto 2GB
  12. do you have friends?

  13. do you have friends?

  14. mēs idioti nevaram saprast :D .. tev ir tabula kur tu pievieno tos savus "items" ja? un tu gribi pievienot tam itemam vel url? kur tos linkus izmantos? :D
×
×
  • Create New...