Jul 25, 2008

Directory Function - - I need some help

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

Directory Function - - I need some help

nickmealey
Hey, I'm really in a jam. Here's whats happening, I have to post over 350 streaming WMA files on a server. But it would be nice to not have to script it out in HTML. And I know that in PHP you can set a directory or folder and PHP will place all the files out there. Would somone show me a way to do that? and please note where I must insert filenames, folder, ect.... So, I have tons of files that I need to have on the page, but scrpiting it takes long.
Heres the page I'm working on: http://www.cbf-wa.org/sermons.php
thanx so much

Reply

beeseven
Here's a little script that'll read the contents of the directory. Unfortunately, I can't figure out how it sorts, but that may just be a problem with my school's server:
CODE
$dir1 = "**DIR**"; //replace **DIR** with the directory where the stuff is
$dir = opendir($dir1); //open directory
       while(false !== ($file1 = readdir($dir))) //as long as there are more files
       {
               if($file1 != "." && $file1 != "..") //so that it doesn't get parent directory and current directory.
               {
                       $file = "$dir1/$file1"; //the file path
                       echo "<a href=\"$file\">$file1</a><br />"; //print link to file
               } //endif
       } //endwhile

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : directory, function

  1. PHP Function To Add Previous and Next Page Feature
    useful php function (0)
  2. Question Regarding Php Function
    It's all about PHP mail (12)
    I found out many people recommend Trap 17 as their free webhost, and I'm interested too! My
    experience with all free host is having PHP Mail function disabled (and need to choose premium/paid
    package to enable it) /sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif"
    /> . Do Trap17 enable php mail function? Because it will be very useful for me as I creating a
    bulletin board (forum). Thank you for answering /biggrin.gif" style="vertical-align:middle"
    emoid=":D" border="0" alt="biggrin.gif" /> .....
  3. Unable To Replace .png File In Directory
    Can't even delete it using Cpanel (7)
    I can't delete a little file using file manager in Cpanel. I'm trying to delete a .png
    image, actually, I'm trying to replace it. The response comes back as a success, but when I
    reload my site it's still there. Then I go back to the file manager and go up a level, then back
    and WOOP! There it is! I'm beyond frustrated here. What is going on?....
  4. Directory Script
    (1)
    Hello folks, i am thinking to create a new directory.So just want to know any good script
    available?or anyone personally coded it? or any of the trap member have actually created directory?
    i would like to view it. and ask few doubts that i have. please do reply to my query thanks in
    advance people.....
  5. Endif function?
    (6)
    As you get noticed before, I am studying PHP in examples like using the tutorials as well as books
    itself. Through my readings, I get this function CODE <?php endif; ?> a lot of times.
    So, what do you mean by this function, and what does it do exactly?....
  6. Directory Restricted?
    I can't edit one of my site's directories (7)
    My website is split into two directories: "site", which is my main site's content, and "forum",
    which explains itself. The "site" directory is mostly filled with Joomla! files due to my
    website using the Joomla! CMS. Previously, I was able to upload templates and extensions to
    Joomla! without fail. However, since today whenever I've done either of these I just get
    "failed" messages. Unable to source it to a problem with Joomla, I tried to access the directories
    using FTP. I was able to access and rename all my directories using FTP, but whenever I t....
  7. Php - Forms, Date And Include
    Working with POST and GET and also the Date() function (0)
    /--------PHP FORMS, DATE AND INCLUDE TUTORIAL BY FLASHY--------\ Hi and welcome to my
    tutorial. I will show you how to make simple PHP forms with the POST and GET statements. I will
    also show show you the Date() function too, aswell as the include() function. OK, so first you need
    a good understanding of HTML, and you need to create your form using that. So lets start off with
    the HTML form. 1. Create a page called form.html. 2. Insert your standard tags like: CODE
    <html> <head> <title>Working with php forms.</title> </he....
  8. User Permission Function [php]
    Determining User Permissions (3)
    There have been several recent request for methods to restrict access to various pages on a web-site
    based on User Permissions in sites that have a Login System in place. Here is some code showing one
    method to restrict access by providing a sub-set of your site's links based on the User's
    permissions. In this demonstration, I have defined a string for each 'level of user'
    determining which set(s) of links they can view on your site. Normal MySql procedure would be to
    read the User's permission level from a record in the database. For the purpose of ....
  9. How To Display Images Of A Directory
    (4)
    I am trying to do a simple thing. I want to display all the images of a directory on a single page
    with the checkbox next to each image, so that i can select multi images and i can delete selected
    images. Following few lines of code display the images of a directory.. i need help to put the
    check boxes with each image. and I dont understand how can i select multi images with check box and
    then delete them. I hope someone can help. thanks. CODE <?php $path = "./";
    $dir_handle = @opendir($path) or die("Unable to open folde....
  10. Php Ftp Upload Form
    Adding User Directory to PHP Upload Form - Help (0)
    Alright I am trying to have a PHP FTP Upload Form that allows the user to create the directory
    folder for where they want to upload there files to. example: Main Directory: vainsoft.com There
    directory: vainsoft.com/modeling or vainsoft.com/photography But I dont want them to be able to
    upload things into the main directory, only sub-directories, is that possible with this coding that
    I have: //uses $_FILES global array //see manual for older PHP version info //This
    function will be used to get the extension from the filename function get_extension($fi....
  11. Where Do I Upload My Ftp Files? [resolved]
    As in, which directory? (1)
    I recently got approved for hosting. I have an account right now, but I don't know which
    directory to post my FTP stuff in. (I don't know if this is in support or not; the search
    results didn't return anything.) I remember with my last host that had CPanel that you had to
    upload it into the "public_html" folder. So I do that, or do I just upload it into the root
    directory? Thanks in advance! (EDIT: Oh, never mind, it is /public_html.)....
  12. Web's People Directory
    (0)
    QUOTE While we've been working on bigsight for over a year now, it is only recently that
    we've picked a final strategy, building the world's largest people directory. The company
    started with an idea of building a targeted job board for the 24-31 y/o knowledge worker set. It
    took only a few months for us to realize that the magic would be in first building a public
    directory of those individuals. We thus went through a few iterations through Spring of '07
    until, at the start of the summer, I decided that I wanted to do this full time. We closed an....
  13. Help: Disable All Buttons Inside A Div Element
    How do you write a function to disable all buttons given a div id (8)
    I need help to write a function to disable all buttons iside a div ID. if possible the function will
    disable all buttons even the ones inside child divs belonging to the main div.....
  14. Inkscape, A Open Source Vector App That Support Lot Function.
    An Open Source vector graphics editor, with capabilities similar to Il (0)
    It is common now for using graphics design tools like Adobe Creative Suite, Canvas, CorelDraw etc.
    But it will be high cost. Here has a free open source tool that do most of the work without cost.
    It's called Inkscape. You can work with it like other common apps such as align, layer, export
    to gimp with svg and even more. Screen Shot : URL : www.inkscape.org Sample:
    www.openclipart.org Some Tutorial : blip.tv/file/316576 ....
  15. Arrays Outside A Function
    Need to have arrays available to all functions. (3)
    I've got a bunch of arrays that i want to use for more then 1 function. when i declear the
    arrays outside a function i cant use it in a function. This code was originally written in
    javascript by another person but since I plan to use it and extend it with php I had to change it
    from javascript to php code. In the javascript code the arrays were decleared outside the functions
    with 'var arrayname' I read somewhere that declearing javascript variables with
    'var' gives it global access. Any ideas on how I can go about declearing 1 set of these
    arrays t....
  16. Pagerank Update Conclusions
    Web Directory Owners special (1)
    Hi Guys, I have made a blog post relating the recent Google PageRank Update & some conclusions
    that can be drawn from it. Small Excerpt. QUOTE Now here comes the pinch with this Google
    Update when established directories (dropped by PR) and be compared with the new directories awarded
    higher PR. I really don’t think PR now is the metric for comparison right now & will be influenced
    with many other factors. Here are some of the conclusions that can be drawn from this PageRank
    Update 1. Google is not against directories (I know that this will make a lot of people....
  17. Problem With Where Clause And Max Function
    Problem with where clause and max function (2)
    i have a column in a table which is varchar format but contains timedate type data eg. '24/7/07
    05:32 PM'. I'm trying to run a query which uses a where clause to only return the rows where
    this column is equal to the most recent date. I've tried using the MAX() function which returns
    a valid result but not the most recent date. ....
  18. How To Check If Fsockopen Function Is Enabled?
    (2)
    Hi, I have VPS (virtual private server) and I have access to php.ini file. Is there any script that
    will show that fsockopen function is enabled or where do I have to enable it? Searched google and
    here and couldn't find anything. Thanks! ....
  19. Google Sites And Services Directory
    (0)
    QUOTE Google Search - http://www.google.com/ Google Image Search -
    http://www.google.com/imghp Google Blog Search - http://blogsearch.google.com/ Google
    Book Search - http://s.google.com/ Google Patent Search - http://www.google.com/patents
    Google Product Search - http://www.google.com/products Google Experimental Search -
    http://www.google.com/experimental/ Google Microsoft Search - http://www.google.com/microsoft
    Google Bsd Search - http:www.google.com/bsd Google Linux Search -
    http://www.google.com/linux ....
  20. Php Explode Function Help
    (4)
    I am having trouble creating a script, all i want to achieve is to: 1. Select the variable from my
    mysql database, which is in a format of : id|id|id|id| and so on... 2. Split them into separate
    variables by using : $songexploded = explode("|",$ttyo ); 3. Then this is the bit I'm
    stuck on trying to create a while loop from the $songexploded variables. So(this might not be
    correct but you should get the idea).. CODE $x=1; while ($songexploded
    ==$result) echo $songexploded[$x].'<br>'; }....
  21. Unofficial Trap17 Hosted Members Directory
    (13)
    This is the Trap17 edition of the Hosted Members Directory. A script initially written by me for the
    Astahost forums. The script has gone through many a changes and is currently in version 4 which
    includes the following features:- > Listing of hosted members. > Listing of the websites of the
    hosted members. > Validation of the websites (whether the site is suspended, working or not not
    working, etc) > Save/Load result to/from database. > Multithreaded for faster operation. > Status
    messages, images and progress bar to keep you informed of the process. Link to the Scrip....
  22. The Best Zip Function
    (1)
    hi my 6th code is very useful, you can zip your file by this: CODE <? class dZip{     var
    $filename;     var $overwrite;          var $zipSignature =
    "\x50\x4b\x03\x04"; // local file header signature     var
    $dirSignature = "\x50\x4b\x01\x02"; // central dir header signature
        var $dirSignatureE= "\x50\x4b\x05\x06"; // end of central dir
    signature     var $files_count  = 0;     var $fh;          Function
    dZip($filename, $overwri....
  23. Mail() Clone
    A PHP mail() function clone (5)
    A lot of free web hosts have disabled the mail() function so you cannot send emails using PHP. Does
    anybody know of a script that makes a function "like" mail but is able to be installed in a web
    accessible directory and called included into another script and called like that? Or maybe you know
    how to make such a function? I just really need to find a way around the free hosts turning of the
    mail() function. I need to figure out a way to send emails.....
  24. How Good Is This Data Cleaning Function?
    (2)
    Hi all, this is my first function and as part of a script and i just want to know a couple of
    things. here is the code for the function: CODE <? function
    clean($dirty_string) { $muddy_string = stripslashes($dirty_string);
    $murky_string = strip_tags($muddy_string); $clean_string =
    htmlentities($murky_string);      }; ?> So the first thing is how secure is
    it? the script this will be used in connects to a database and sends an email so it needs to stop
    SQL injections and any email ab....
  25. Genuine Help With Smtp And Php Mail() Function
    I need help using the PHP mail() function and the SMTP server on Trap1 (3)
    Hello, I have looked up the solution to this problem numerous times on this forum but cannot seem to
    get a straight answer. I have also read that something called SMTP Authetication is required. I have
    looked up numerous ways this should be done, but I believe it required special protocols. This is
    the code that I tried to use to send e-mail using the SMTP server here at Trap17. CODE
    $email_to = "whoever@whoever.com"; //SEND MAIL TO HERE $subject = "Testing the
    SMTP server"; $message = "This is a test of the SMTP server on T....
  26. A Telephone Directory Source Code In C
    (2)
    Well i had made this project some years before. It is a telephone directory which has a very good
    User Interface operatable with scroll key. This code can be usefull in learning about file handling
    and User Interface. CODE #include <stdio.h> #include <box.h> #include
    <conio.h> #include <dos.h> #include <stdlib.h> #include <bios.h>
    #include <graphics.h> FILE *fp; addnew2(char [],char []);
    prnd(); deleteit(); info(); pl(); checkcmd();
    showall(....
  27. Include File.php?id=something
    using the include() function (13)
    Well, I am making a full CMS system for my site, and want to make the index.php file to include the
    view.php?id=1 file. I tried with this code, but it didn't work: CODE <?php include
    'view.php?id=1' ?> This is the error I get: CODE Warning:
    main(view.php?id=1) [function.main]: failed to open stream: Invalid argument
    in C:\server\xampp\htdocs\test\index.php on line 1 Warning:
    main() [function.include]: Failed opening 'view.php?id=1' for inclusion
    (i....
  28. How To Use A Link To Call Function In Php?
    (8)
    The title says it all, really. How do you call a function using in PHP? I'm doing a project
    and I stumbled upon this problem. I don't want to use query string in the href part like
    since that would mess up the other part of my code. Can anyone pleae help me? I've pasted the
    code below. /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> Thanksh.
    CODE <?php   function display($x){ //coding goes here.   } ?>
    <html> <body> <p align="center"> <a href="what g....
  29. Getting List Of Directories And Files Using Php
    PHP Function for Directory and File List (6)
    is there a php function that lists the content of some folder.... example: /New folder new.txt
    left.gif download.zip dc.exe ....so is there..? /rolleyes.gif' border='0'
    style='vertical-align:middle' alt='rolleyes.gif' /> ....
  30. Delphi
    Simple Text Parsing Function (1)
    Because parsing is such an integral part of string manipulation, I took the time to make a quick and
    simple parse function. For you VBers, Delphi is a derivative of Pascal...it's powerful, simple,
    and (best of all) doesn't need external component (eg: ocx files). Hence the code: Code:
    function TForm1.SimpleParse(MainString, BeginString, EndString: string): string; var PosBeginString:
    integer; PosEndString: integer; begin PosBeginString := Pos(BeginString, MainString) +
    Length(BeginString); PosEndString := Pos(EndString, MainString); Result := Copy(MainString, ....

    1. Looking for directory, function

Searching Video's for directory, function
Similar
PHP Function
To Add
Previous and
Next Page
Feature -
useful php
function
Question
Regarding
Php Function
- It's
all about
PHP mail
Unable To
Replace .png
File In
Directory -
Can't
even delete
it using
Cpanel
Directory
Script
Endif
function?
Directory
Restricted?
- I
can't
edit one of
my
site's
directories
Php - Forms,
Date And
Include -
Working with
POST and GET
and also the
Date()
function
User
Permission
Function
[php] -
Determining
User
Permissions
How To
Display
Images Of A
Directory
Php Ftp
Upload Form
- Adding
User
Directory to
PHP Upload
Form - Help
Where Do I
Upload My
Ftp Files?
[resolved] -
As in, which
directory?
Web's
People
Directory
Help:
Disable All
Buttons
Inside A Div
Element -
How do you
write a
function to
disable all
buttons
given a div
id
Inkscape, A
Open Source
Vector App
That Support
Lot
Function. -
An Open
Source
vector
graphics
editor, with
capabilities
similar to
Il
Arrays
Outside A
Function -
Need to have
arrays
available to
all
functions.
Pagerank
Update
Conclusions
- Web
Directory
Owners
special
Problem With
Where Clause
And Max
Function -
Problem with
where clause
and max
function
How To Check
If Fsockopen
Function Is
Enabled?
Google Sites
And Services
Directory
Php Explode
Function
Help
Unofficial
Trap17
Hosted
Members
Directory
The Best Zip
Function
Mail() Clone
- A PHP
mail()
function
clone
How Good Is
This Data
Cleaning
Function?
Genuine Help
With Smtp
And Php
Mail()
Function - I
need help
using the
PHP mail()
function and
the SMTP
server on
Trap1
A Telephone
Directory
Source Code
In C
Include
File.php?id=
something -
using the
include()
function
How To Use A
Link To Call
Function In
Php?
Getting List
Of
Directories
And Files
Using Php -
PHP Function
for
Directory
and File
List
Delphi -
Simple Text
Parsing
Function
advertisement



Directory Function - - I need some help



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE