Jump to content
php.lv forumi

Skaita cik reizes novilkts fails!


janisetnies

Recommended Posts

janisetnies --> tune tikai prasi gatavis skriptus,bet pat nemegjini uzklausiit ko tev saka !

---

izmanto to pashu text conteri ...

---------

<a href="bla.php">bla<?php te atver kontera raditaju ?></a>

-----

bla fails:

ieraksti conterii skaitu :

redirekte uz bla_y.zip

---------

VISS ....

tiesham pasham nav pat kripatinjas logjikas?

Link to comment
Share on other sites

laikam sapratu!

 

apmēram tā: <a href="fails.php">lejupladet failu<a />

 

fails.php:

pieskiata +1 txt failam un include("faili/fails.zip");

 

apmērma tā ja?

 

Sanāk ka katru reizi būs jātaisa jauns fails! Bet nu tie faili bieži nebūs!

Edited by janisetnies
Link to comment
Share on other sites

<?php header('Location: bla.zip'); ?>

<?php

if (file_exists('bla.txt')) 
{
	$fil = fopen('bla.txt', r);
	$dat = fread($fil, filesize('video.txt')); 
	echo $dat+1;
	fclose($fil);
	$fil = fopen('bla.txt', w);
	fwrite($fil, $dat+1);
}

?>

 

Kas šeit nepareizi?

Link to comment
Share on other sites

Nestrādā, uzmet šādu eroru:

 

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/faili/fails.php:2) in /var/www/html/faili/fails.php on line 2

 

otrā rinda: <?php header('Location: bla.zip'); ?>

Edited by janisetnies
Link to comment
Share on other sites

pasaki kam tev skripta vajaga echo $dat+1;, kuru tapatas neviens neredzes ??? Un andrisp ir uzrakstiji labu postu par headers already sent by, ir links tepat foruma !!!

Link to comment
Share on other sites

×
×
  • Create New...