janisetnies Posted July 20, 2007 Report Share Posted July 20, 2007 Kā uztaisīt, lai kods skaita cik reizes novilkts fails, un faila adreses galā parādas Xrezies (X=cipars)? Un vēl kā uztaisīt vienkāršu skaitītāju, kas skaita cik cilvēki apmeklējuši noteiktu lapu? Paldies iepriekš! Link to comment Share on other sites More sharing options...
Grey_Wolf Posted July 20, 2007 Report Share Posted July 20, 2007 (edited) ja fails nav parak gigantisks tad vinju izlaid caur file open un pa rindijai (baitiem suti prom...) sava laika ko lidzigu taisiju ... pamekle tepat foruma tas ir runats.... ieprieksh no Db (vai faila) nolasot skaitu un nosaukumam piekabinot to klat shai metodei liels pluss ir tas ka neviens nezinas kur tas fails Faktiski glabajas..... un nosaukumu kaut katram savadaku.... --- vienkarsh skaitiitaajs: ja ar DB tad... UPDATE tabulis skaits=skaits+1 ja faila tad : atver failu nolasi skaitu .. pieskaiti 1 ieraksti atpakalj faila... (lielakais trukums ir tas ka , ja skatisies 2 vai vairak cilveki vienlaicigi tad dati buus nekorekti) edit: shita var padot failu no php skripta header ("Content-Disposition: filename=faila_nosaukums_ar_visu.paplasinajumu"); $fp2=filesize("realais_faila_nosaukums_atrasanas_vieta"); $fp=fopen("realais_faila_nosaukums_atrasanas_vieta", "r"); $output=fread($fp,$fp2); fclose($fp); echo $output; protams pirms tam Nedriks buut nekada izvade -> ka arii pec tam neko nedrikst izvadiit..... tikai un vieniigi driks buut tiirs PHP skripts (pec shii fragmenta tad arii leic lai ieraksta Db do skaitu /pirms tam brivi vari arii to skaitu nolasiit , BET ATKARTOSHOS NEKADU CITU ECHO (print) nedrikst buut...) edit2: neaizmirst arii kad scripts beidzas tad peec ?> NEDRIKS but arii izvade --> tuksha linija vai parnesana jauna rinadaa arii BUS izvade.... tobish kaa ?> ir skripta faila peedeejie Baiti.... Edited July 21, 2007 by Grey_Wolf Link to comment Share on other sites More sharing options...
janisetnies Posted July 21, 2007 Author Report Share Posted July 21, 2007 Faili ir ap 100 200 300 400 mb! Link to comment Share on other sites More sharing options...
bubu Posted July 21, 2007 Report Share Posted July 21, 2007 Nevajag nekādus fopen/fread/fclose/echo izmantot. Tam paredzēta viena funkcija - readfile. Link to comment Share on other sites More sharing options...
janisetnies Posted July 21, 2007 Author Report Share Posted July 21, 2007 (edited) Es neko nesparotu! Tad kā izvediot to skaitītāju? Tā lai rāda cik reizes fails novilkts! Edited July 21, 2007 by janisetnies Link to comment Share on other sites More sharing options...
bubu Posted July 21, 2007 Report Share Posted July 21, 2007 Visa informācija par to kā izveidot ir #2 postā. Link to comment Share on other sites More sharing options...
janisetnies Posted July 22, 2007 Author Report Share Posted July 22, 2007 Vardūt kāds man var uzrakstīt kodu kas skaita cik reizes ir uzspiestas uz noteikta linka, un reizes parāda linka galā? Paldies jau iepriekš! Pats nemāku tik labi vēl php! Link to comment Share on other sites More sharing options...
janisetnies Posted July 23, 2007 Author Report Share Posted July 23, 2007 Un vai to var uzskaitīt bez datubāzes ar txt failiem? Vajag lai skaita cik reizes nospiests uz noteikta linka! Link to comment Share on other sites More sharing options...
Grey_Wolf Posted July 23, 2007 Report Share Posted July 23, 2007 Un vai to var uzskaitīt bez datubāzes ar txt failiem? atkartoshos ja jau lasiit nemaki !!!! ------- ja faila tad : atver failu nolasi skaitu .. pieskaiti 1 ieraksti atpakalj faila... --------------------- Link to comment Share on other sites More sharing options...
rpr Posted July 23, 2007 Report Share Posted July 23, 2007 varbuut vinekaarshak apskatiities to log failaa? par pamatu panjemot veel kaadu web logu analizatoru? awstats, webalizer etc Link to comment Share on other sites More sharing options...
janisetnies Posted July 23, 2007 Author Report Share Posted July 23, 2007 Kads nevar uzrakstit kodu? Link to comment Share on other sites More sharing options...
Agnisr Posted July 23, 2007 Report Share Posted July 23, 2007 ibiom... google.lv pirmais rezultaats peec "txt counter" un jau sekmiigs - tieshi tas, kas tev vajadziigs. http://www.tutorials.de/forum/php-tutorial...xt-counter.html Link to comment Share on other sites More sharing options...
janisetnies Posted July 23, 2007 Author Report Share Posted July 23, 2007 Es laikam netā esmu nodefinējis jautājumu! Man piemēram ir *.zip faili un lapa, kurā ir linki uz tiem un vajag uzskaitīt cik reizes viņi ir novilkti! Link to comment Share on other sites More sharing options...
Agnisr Posted July 23, 2007 Report Share Posted July 23, 2007 otrs tavs jautaajums bij par apmekleetaaju counteri... uz to arii sniedzu atbildi! Pirmais jautaajums arii tika atbildeets, ieraksti googlee fileopen - pameklee scriptus saistiibaa ar download counter. noteikti atradiisi mekleeto! neviens tavaa vietaa nerakstiis scriptu! Link to comment Share on other sites More sharing options...
janisetnies Posted July 23, 2007 Author Report Share Posted July 23, 2007 Nu jā, mēģināšu! Link to comment Share on other sites More sharing options...
Recommended Posts