Jump to content
php.lv forumi

php read from folder


ziedinjsh

Recommended Posts

Šāds ir cods:

<?php
$dir = "./mp3";

$dh = opendir($dir);

while (($file = readdir($dh)) !== false) {
       echo "<A HREF=\"$file\">$file</A><BR>\n";
}

closedir($dh);
?>

Viņš parādā failu kas atrodas mp3 folderī. Tas viss ir labi, bet zem faila viņš rāda vēl divus linkus .. un . kā viņus var noņemt un kā var piešķirt katram failam id?

Link to comment
Share on other sites

Lieta tāda piemērām es tagad uztaisu linku šādu <a href='mp3/$file'>$file</a>

atverot pirmkodu es redzu ka ir links <a href='http://mp3.domens.lv/mp3/dziesmas_nosaukums.mp3'>dziesmas nosaukums.mp3</a>

 

bet pie flash playera

<embed src="http://www.strangecube.com/audioplay/online/audioplay.swf?file=mp3/$file&auto=no&sendstop=yes&repeat=1....

vai

<embed src="http://www.strangecube.com/audioplay/online/audioplay.swf?file=http://mp3.domens.lv/mp3/$file&auto=no&sendstop=yes&repeat=1...

 

man neuzrādās links un tapēc neskan.. skatoties caur pirmkodu tur arī tā pat rādas mp3/$file ?? kapēc tā?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...