Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
NewGuy каза:Код:<?php $size = getimagesize("адреса"); echo "$size"; ?>
<?php
function urlfilesize($url,$thereturn) {
if (substr($url,0,4)=='http') {
$x = array_change_key_case(get_headers($url, 1),CASE_LOWER);
$x = $x['content-length'];
}
else { $x = @filesize($url); }
if (!$thereturn) { return $x ; }
elseif($thereturn == 'mb') { return round($x / (1024*1024),2) ; }
elseif($thereturn == 'kb') { return round($x / (1024),2) ; }
}
?>
<?php
echo echo urlfilesize('http://www.virginiarecords.com/site/tracks/Metallica%20-%20The%20Day%20That%20Never%20Comes.mp3','mb'); echo "mb";
?>
NewGuy каза:Кое не можеш?
Код:<?php echo urlfilesize('http://www.virginiarecords.com/site/tracks/Metallica%20-%20The%20Day%20That%20Never%20Comes.mp3','mb'); echo "mb"; ?>
Кода работи пробвах го.
else if($option=='music')
{
$id = $_GET['id'];
$db = mysql_query("SELECT * FROM music WHERE id='$id'");
$i = 0; // prisvoqvame na $i stoinost 0
while($row = mysql_fetch_assoc($db))
{
$kategoria = $row['kategoria'];
$kategoria = mysql_fetch_assoc(mysql_query("SELECT kategoria FROM catsmusic WHERE id='$kategoria'"));
$kategoria = $kategoria['kategoria'];
$ispylnitel = $row['ispylnitel'];
$pesen = $row['pesen'];
$slushana = $row['slushana'];
$download = $row['download'];
$link = $row['link'];
$kachil = $row['kachil'];
function urlfilesize($url,$thereturn) {
if (substr($url,0,4)=='http') {
$x = array_change_key_case(get_headers($url, 1),CASE_LOWER);
$x = $x['content-length'];
}
else { $x = @filesize($url); }
if (!$thereturn) { return $x ; }
elseif($thereturn == 'mb') { return round($x / (1024*1024),2) ; }
elseif($thereturn == 'kb') { return round($x / (1024),2) ; }
}
$promenliva="$link";
if($i%1 == 0)
{
echo "<center><div class='middle'
<div class='middle_gore_border'>
<div class='middle_gore2'>
<div class='title'><center><h3>Вие слушате <span style='color:red;'>$ispylnitel - $pesen</span></h3><center></div> <div class='middle_prazno'><table style='font:14px Tahoma;color:#2379ba;' width='400px'><tr>";
}
echo " <td><strong>Изпълнител</strong>: $ispylnitel<br>
<strong>Име на песента</strong>: $pesen<br>
<strong>Слушай</strong>: <object class='playerpreview' type='application/x-shockwave-flash' data='player_mp3_maxi.swf' width='200' height='20'>
<param name='movie' value='player_mp3_maxi.swf' />
<param name='FlashVars' value='mp3=$row[link]&showstop=1&autoplay=1&showvolume=1&bgcolor1=189ca8&bgcolor2=085c68' />
</object>
<br> <strong>Категория</strong>: <a href='index.php?option=cat&id=$row[kategoria]'>$kategoria</a> <br />
<strong>Слушана</strong>: $slushana<br>
<strong>Сваляна</strong>: $download<br>";
?>
<?php
echo urlfilesize('.$promenliva.','mb');
echo "mb";
?>
<?php
echo "
<strong>Качена от</strong>: <span style='color:gold;'>$kachil</span><br>
<a href='index.php?option=comments&id=$id'><img src='style/images/comments.gif' style='border:0px;' title='Коментари за песента!'></a>
<a href='index.php?option=out&id=$id'><img src='style/images/download.gif' style='border:0px;' title='Теглене на песента!'></a>
<a href='index.php?option=error&id=$id'><img src='style/images/error.gif' style='border:0px;' title='Уведоми за грешка!'></a><br />
<hr style='color: orange;' width='350px'>
<center><span style='color: blue;'><span style='color:white;'>Създател MaLa_NocHe, всички права са запазени 2009 г.</span></span></center>
</body>
</html></td>";
mysql_query("UPDATE music SET slushana=slushana+1 WHERE id='$id'");
$i++;
}
}
else if($option=='music')
{
$id = $_GET['id'];
$db = mysql_query("SELECT * FROM music WHERE id='$id'");
$i = 0; // prisvoqvame na $i stoinost 0
while($row = mysql_fetch_assoc($db))
{
$kategoria = $row['kategoria'];
$kategoria = mysql_fetch_assoc(mysql_query("SELECT kategoria FROM catsmusic WHERE id='$kategoria'"));
$kategoria = $kategoria['kategoria'];
$ispylnitel = $row['ispylnitel'];
$pesen = $row['pesen'];
$slushana = $row['slushana'];
$download = $row['download'];
$link = $row['link'];
$kachil = $row['kachil'];
function urlfilesize($url,$thereturn) {
if (substr($url,0,4)=='http') {
$x = array_change_key_case(get_headers($url, 1),CASE_LOWER);
$x = $x['content-length'];
}
else { $x = @filesize($url); }
if (!$thereturn) { return $x ; }
elseif($thereturn == 'mb') { return round($x / (1024*1024),2) ; }
elseif($thereturn == 'kb') { return round($x / (1024),2) ; }
}
$replace=str_replace(" ","%20",$link)
$promenliva="$replace";
if($i%1 == 0)
{
echo "<center><div class='middle'
<div class='middle_gore_border'>
<div class='middle_gore2'>
<div class='title'><center><h3>Вие слушате <span style='color:red;'>$ispylnitel - $pesen</span></h3><center></div> <div class='middle_prazno'><table style='font:14px Tahoma;color:#2379ba;' width='400px'><tr>";
}
echo " <td><strong>Изпълнител</strong>: $ispylnitel<br>
<strong>Име на песента</strong>: $pesen<br>
<strong>Слушай</strong>: <object class='playerpreview' type='application/x-shockwave-flash' data='player_mp3_maxi.swf' width='200' height='20'>
<param name='movie' value='player_mp3_maxi.swf' />
<param name='FlashVars' value='mp3=$row[link]&showstop=1&autoplay=1&showvolume=1&bgcolor1=189ca8&bgcolor2=085c68' />
</object>
<br> <strong>Категория</strong>: <a href='index.php?option=cat&id=$row[kategoria]'>$kategoria</a> <br />
<strong>Слушана</strong>: $slushana<br>
<strong>Сваляна</strong>: $download<br>";
?>
<?php
echo urlfilesize('.$promenliva.','mb');
echo "mb";
?>
<?php
echo "
<strong>Качена от</strong>: <span style='color:gold;'>$kachil</span><br>
<a href='index.php?option=comments&id=$id'><img src='style/images/comments.gif' style='border:0px;' title='Коментари за песента!'></a>
<a href='index.php?option=out&id=$id'><img src='style/images/download.gif' style='border:0px;' title='Теглене на песента!'></a>
<a href='index.php?option=error&id=$id'><img src='style/images/error.gif' style='border:0px;' title='Уведоми за грешка!'></a><br />
<hr style='color: orange;' width='350px'>
<center><span style='color: blue;'><span style='color:white;'>Създател MaLa_NocHe, всички права са запазени 2009 г.</span></span></center>
</body>
</html></td>";
mysql_query("UPDATE music SET slushana=slushana+1 WHERE id='$id'");
$i++;
}
}
NewGuy каза:$replace=str_replace(" ","%20",$link)
Промени на...
$replace=str_replace(" ", "%20", "$link")
relax каза:NewGuy каза:$replace=str_replace(" ","%20",$link)
Промени на...
$replace=str_replace(" ", "%20", "$link")
По-лесно е urlencode();
Pr0oF каза:Абре мъжки, липсва ти точка и запетая след , $link)