Kefiirs Posted January 19, 2008 Report Share Posted January 19, 2008 Nu šis ir skripts un man vajag, lai viņš ik pēc 15 min. atjaunotos (REFRESH)! Lai ik pēc 15 min. skripts pats no sevis atjaunojas! <html> <head> <title>demo</title> </head> <body> <? function zipcompressfile($source,$destination,$filename,$level=false) { $dest=$destination.$filename.'.zip'; $mode='wb'.$level; $error=false; echo $source.$filename.' -> '.$dest.'<br>'; if($fp_out=gzopen($dest,$mode)) { if($fp_in=fopen($source.$filename,'rb')) { while(!feof($fp_in)) { gzwrite($fp_out,fread($fp_in,1024*512)); } fclose($fp_in); } else { $error=true; } gzclose($fp_out); } else $error=true; if($error) return false; else return $dest; } $demo_dir = 'C:/demo/lololol/'; // Folder with .dem files $dl_dir = 'C:/AppServ/www/demo/hz'; // Folder, where to put compressed files $handle = opendir($demo_dir); if ($handle) { while (false !== ($fails = readdir($handle))) { if ( preg_match("/(.*).dem/", $fails, $demo) ) { zipcompressfile($demo_dir, $dl_dir, $fails); unlink($demo_dir.$fails); } } closedir($handle); } ?> <meta http-equiv="Refresh" content="1800;URL=#" /> </body> </html> Un apskata skripts: <?php if ($handle = opendir('C:/AppServ/www/demo')) { while (false !== ($file = readdir($handle))) { if (strlen($file) > 4) { $gabali = explode("-", $file); $date = $gabali[1]; $mape = $gabali[2]; $mapesgabali = explode(".", $mape); $name = $mapesgabali[0]; $year = substr($date,0,2); $month = substr($date,2,2); $day = substr($date,4,2); $hour = substr($date,6,2); $minute = substr($date,8,2); echo "<center>$day.$month.$year $hour:$minute $name <a href=\"http://manskrutaiswebs/demo$file\">Download</a></br></center>"; } } closedir($handle); } ?> Apskata skriptam neko nevajag močīt klāt, tikai tam 1-ajam! :) Vnk lai viņš links, kur atrodas skripts atjaunojas ik pēc 15 min.!!! Paldies jav iepriekš! Link to comment Share on other sites More sharing options...
Klez Posted January 20, 2008 Report Share Posted January 20, 2008 (edited) shito uzdevumu vajag uzticeet os riikiem nevis php. linuks gadiijumaa uztaisam skriptu kas seezh crontab`aa un ik peec laika skataas vai nav jauns fails to pashu uz windows, tikai tad vinsh seedees Scheduled Tasks. tavaa gadiijuma buus taa ka tev vajag mazinju naglinju iesist, a tu ar riktiigu kuvaldu to gribi dariit ... bet ja negribi ar os riikiem, tad jebkuraa gadiijumaa tev buus jaaizmanto Scheduled Tasks, lai to palaistu. kas ir Scheduled Tasks ? skaties te Edited January 20, 2008 by Klez Link to comment Share on other sites More sharing options...
Kefiirs Posted January 20, 2008 Author Report Share Posted January 20, 2008 (edited) shito uzdevumu vajag uzticeet os riikiem nevis php. linuks gadiijumaa uztaisam skriptu kas seezh crontab`aa un ik peec laika skataas vai nav jauns fails Njaa...man ir SystemScheduler, bet kā man to izdarīt? SystemScheduleris prasa: Es nezinu ko pie tā Application jāņem! :( Kā lai es to skriptu atjaunoju? Nu lai man demo atjaunotos, man ir jāieiet linkā demo.php un tikai tad demo faili parādas vajadzīgajā direktorijā! Man vnk vajag skriptu vai kaut ko tamlīdzīgu, lai links/skripts atjaunotos ik pēc 15 min.!!! Edited January 20, 2008 by Kefiirs Link to comment Share on other sites More sharing options...
andrisp Posted January 20, 2008 Report Share Posted January 20, 2008 php.exe tavs_skritps.php Link to comment Share on other sites More sharing options...
Kefiirs Posted January 20, 2008 Author Report Share Posted January 20, 2008 php.exe tavs_skritps.php Nu ja to es pats maku, bet tiklidz ielieku pie application mans_skripts.php vinsh pec ta noteikta laika vinju neatjauno bet vnk atver caur Dreamweawer! :D Link to comment Share on other sites More sharing options...
andrisp Posted January 20, 2008 Report Share Posted January 20, 2008 Nujā, bet vai tu ieliki tur tieši "C:\celhs\uz\php.exe skripts.php" vai ari vienkārši "skripts.php" ? Link to comment Share on other sites More sharing options...
Kefiirs Posted January 20, 2008 Author Report Share Posted January 20, 2008 Nujā, bet vai tu ieliki tur tieši "C:\celhs\uz\php.exe skripts.php" vai ari vienkārši "skripts.php" ? Liku ar visu celju! :) Vnk jus scriptam nevarat pielikt klaat kawt kadu REFRESH SKRIPTU? Nu piemeram lapa ik pec 10 sek. vai min. atjaunojas pati no sevis!? Link to comment Share on other sites More sharing options...
Kefiirs Posted January 20, 2008 Author Report Share Posted January 20, 2008 KUR MAN DABUT TO *.EXE?? Man ir vnk demo.php nevis demo.exe! Link to comment Share on other sites More sharing options...
andrisp Posted January 20, 2008 Report Share Posted January 20, 2008 Nav vērts. Link to comment Share on other sites More sharing options...
Kefiirs Posted January 20, 2008 Author Report Share Posted January 20, 2008 Nav vērts. Kapec nav vērts? Jūs man nevarat vienkārši palīdzēt uztaisīt to demo.exe ? Tas jums ir 2 minūšu darbs! Link to comment Share on other sites More sharing options...
andrisp Posted January 20, 2008 Report Share Posted January 20, 2008 (edited) Kas vēl tas par .exe failu ? Ja nepamanīji, tad šeit ir PHP programmētāju forums, nevis Windows programmētāju (ja tā to var nosaukt). Tas jums ir 2 minūšu darbs! Pats nesaprot par ko runā, bet zina jau kas cik mums aizņems... :) Edited January 20, 2008 by andrisp Link to comment Share on other sites More sharing options...
Kefiirs Posted January 20, 2008 Author Report Share Posted January 20, 2008 (edited) Es vnk nezinu kā uztaisīt, lai tas links vai arī fails atjaunojas ik pēc 10 min., lai viņš REFRESH! Tak nevarat pateikt, kā lai es dabonu to *.exe ?? Edited January 20, 2008 by Kefiirs Link to comment Share on other sites More sharing options...
mounkuls Posted January 21, 2008 Report Share Posted January 21, 2008 PHP to var tikai tad kad lapā atnāks kāds lietotājs un darbinās skriptu, nevis pēc tik un tik minūtēm ja neviena lapā nebūs. Link to comment Share on other sites More sharing options...
Aleksejs Posted January 21, 2008 Report Share Posted January 21, 2008 Tak nevarat pateikt, kā lai es dabonu to *.exe ?? Sameklē, kur Tev diskā atrodas php.exe fails (un nestāsti, ka tāda nav!!!) Link to comment Share on other sites More sharing options...
Kefiirs Posted January 23, 2008 Author Report Share Posted January 23, 2008 Ja nu ir fails, bet KO man ar vinju dariit? Ielikt taja SystemScheduler? * Jav meginaaju, pec 10 min. vinsh vnk atver "melno" lodzinu un uzreiz aizver ciet! Man vajag, lai vinsh ATJAUNOTOS! Link to comment Share on other sites More sharing options...
Recommended Posts