Benvenuto Posted July 27, 2005 Report Share Posted July 27, 2005 Man te radaas jautaajums vai ir iespeejams ar php paarbaudiit vai lapa veeljoprojaam eksistee. Piemeeram, ja man ir web katalogs ar 10 000 adreseem, kaut kaa tachu mirushaas ir jaatlasa. Varbuut vareetu man apstaastiit principu kaa tas notiek vai veel labaak paraadiit skriptu. Paldies, viiri. Link to comment Share on other sites More sharing options...
bubu Posted July 27, 2005 Report Share Posted July 27, 2005 Nu droši vien jāveic HTTP GET/HEAD pieprasījums un jāpārbauda HTTP responses kods - 404=lapa not found. Link to comment Share on other sites More sharing options...
Delfins Posted July 27, 2005 Report Share Posted July 27, 2005 Nu droši vien jāveic HTTP GET/HEAD pieprasījums un jāpārbauda HTTP responses kods - 404=lapa not found. 19957[/snapback] da tur daudz iespēju... piemēram ja kaut vai dzinis tiek mainīts - pāradresē fig zin kur. Vai arī DNS atgriež jau citu IP un tā vietā rāda kaut ko citu (bet varbūt headeros šis tas ir) Link to comment Share on other sites More sharing options...
bubu Posted July 27, 2005 Report Share Posted July 27, 2005 Nu tas bij pirmais, kas ienāk prātā un ir visvienkāršākais. Link to comment Share on other sites More sharing options...
Venom Posted July 28, 2005 Report Share Posted July 28, 2005 tas pats if (!@fopen($adrese,'r')) Link to comment Share on other sites More sharing options...
Toms Posted July 28, 2005 Report Share Posted July 28, 2005 (edited) Man ir uztaisīts un labi strādā šādi: if (!@file_get_contents($address)) { // Neizdevās nolasīt. Adrese neeksistējoša } else{ // Var nolasiit, adrese eksistee } EDIT: Vienīgi - šādi pārbaudīšana 20 adresēm notiek apmēram 13 - 18 sekundes. Edited July 28, 2005 by Toms Link to comment Share on other sites More sharing options...
Venom Posted July 28, 2005 Report Share Posted July 28, 2005 bļāviens - kam tev visu lapu nolasīt (file_get_contents), ja vari pārbaudīt tikai to, vai to vispār var atvērt (fopen) un uzreiz vert ciet (fclose)? un strādās ievērojami ātrāk. Link to comment Share on other sites More sharing options...
Toms Posted July 28, 2005 Report Share Posted July 28, 2005 Nu man vajag nolasiit visu lapas "contents". (Un jau pieminēju, ka strādās lēni) Link to comment Share on other sites More sharing options...
Venom Posted July 28, 2005 Report Share Posted July 28, 2005 nu ja vajag - tad neko darīt, jādomā par kādu cron-risinājumu Link to comment Share on other sites More sharing options...
Peeter Posted August 4, 2005 Report Share Posted August 4, 2005 Ludzu kads varetu paskaidrot kapec man neviens no augstakminetajiem variantiem negrib stradat no eclub.lv uz manu serveri <? $address="http://159.148.70.155/index.php"; if (!@file_get_contents($address)) { echo 'Nav'; } else{ echo 'IR'; } ?> <? $wp=fopen("http://159.148.70.155/index.php","r"); if ($wp) { echo 'Iet'; } else{ echo 'Nav'; } ?> Link to comment Share on other sites More sharing options...
Venom Posted August 5, 2005 Report Share Posted August 5, 2005 neesmu pārliecināts, bet uz eclub varētu būt aizliegtas fopen funkcijas Link to comment Share on other sites More sharing options...
bubu Posted August 5, 2005 Report Share Posted August 5, 2005 fopen noteikti ir atļauts. Bet iespējams, ka fopen no url nav atļauts. Link to comment Share on other sites More sharing options...
Peeter Posted August 5, 2005 Report Share Posted August 5, 2005 un kads varetu but risinajums. varbut ir vel kads variants bez shiem Link to comment Share on other sites More sharing options...
Recommended Posts