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.
не картинка например .rar в смисъл не да го показва ми да дава линк или нещо пудобноDido_net каза:Какъв файл? Картинка? :roll:
да ама трябва всеки качен фаил името му да го слагам аз ... а аз искам след като се качи фаила да си се показва от самия скрипт както аз използвам случайна снимка от папка и така като качи някой и си я показва без аз да я слагам и т.н. :?:SharkpenT каза:Еми аз до колкото разбирам може да ти послужи случаен текст ?!
<?php
$directory = opendir(".");
while ($files = readdir($directory))
{
if (($files != "..") AND ($files != ".")){
if (!is_dir($path)){
$path = $dir."/".$files;
$file[]=array (
"name" => $files,
"path" => $path
);
}
}
}
$num = count($file);
$random = rand(0, $num);
echo "<a href=\"".$file[$random][path]."\">".$file[$random][name]."</a>";
?>
$directory = opendir(".");Soul_Stealler каза:Ето :
Код:<?php $directory = opendir("."); while ($files = readdir($directory)) { if (($files != "..") AND ($files != ".")){ if (!is_dir($path)){ $path = $dir."/".$files; $file[]=array ( "name" => $files, "path" => $path ); } } } $num = count($file); $random = rand(0, $num); echo "<a href="".$file[$random][path]."">".$file[$random][name]."</a>"; ?>
Ако имаш проблеми пиши
<?php
$dir = ""; /// ПАПКАТА ! :)
$directory = opendir($dir);
while ($files = readdir($directory))
{
if (($files != "..") AND ($files != ".")){
if (!is_dir($path)){
$path = $dir."/".$files;
$file[]=array (
"name" => $files,
"path" => $path
);
}
}
}
$num = count($file);
$random = rand(0, $num);
echo "<a href=\"".$file[$random][path]."\">".$file[$random][name]."</a>";
?>
стана мерси :?:hrischo каза:Не слагай наклонена черта пред папката,трябва да е така:
$dir = "files/files";