Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





List Contents Of A Folder, Make List Of Links


Does anyone know how I can write a script that:

- reads in all the files in a particular directory
- displays the file names in a html list and makes a link of them:
<ul>
<li><a href="filelocation1">filename 1</li>
<li><a href="filelocation2">filename 1</li>
<li><a href="filelocation3">filename 1</li>
</ul>

etc.?

So basically it creates a list of links with the contents in that directory,
so you can download them from there.




View Complete Forum Thread with Replies

Related Forum Messages:
Make The Lists Into Links - List The Directories Vertically.
<?php
if ($handle = opendir('.')) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
echo "$entry
";
}
}
closedir($handle);
}
?>

to list the contents of a directory on my server. I need to change it to only show directories, make the lists into links, and I need it to list the directories vertically.

View Replies !
List Db Contents
can someone help me make a script that will list the information in one colum in my table! See each clan I have has an ID, and CEO and bla bla bla! But what I want done is it to only show the name of the clan in A dropdown menu. So that when users are signing up they can select the clan they want and it well ya you know puts the name beside theres in the table. But can someone make me a script to list all the clans Names and only names not ID, Ceos, and all that other stuff. Code:

View Replies !
List Contents
Is there any way in PHP to list a folders contents??

View Replies !
Get A Directory Contents List
I recently wrote a script which grabbed a file list via ftp, pretty basic but the one problem is it doesn't work when the ftp server isn't running, is there any way in which I can get file lists without an ftp server.

I looked through the filesystem function list but could find something that stood out as giving a directory list. I am planning on eventually writing a whole file manager, but for now am just developing individual parts.

View Replies !
List Folder Name
I was wondering how to list on a web page the name of the folder that you are currently in. For Example: Let's say the file resides in a folder called Cast Information, is there a script that will display just the name of the folder. I have been searching most all of the eveing and no luck finding anything.

View Replies !
List Subjects That Are Links
I want to list the subjects names which link to the whole bulletin, but am having trouble.

   while ($numofsubs = mysql_fetch_array($result))
   { echo ('<td align=left><a href="viewspecificbull.php?id=' . $numofsubs['Subject'] . '">[/url]</td></br>'); }

View Replies !
File Links In List
what i want to do is store files in a non web accessable folder and thn in a page show links to those files in a list.

what i was wanting to know is could i use a script so when i upload more files to that folder they automatically add into the list? basically show a folder contents in a list in a page.

View Replies !
List All Links From A Webpage
I'd like to list all links (url's, not interested in email adresses) from a web page (htm, html, asp, php ...). I'am not sure if this can be done using php. So please some advice or maybe an example.

View Replies !
Turn $row Into A List Of Links
Ok I want to get a $row=mysql_fetch_rows($result)and turn $row into a list of links where the name of the lin is ALSO stored so that the next page can access the right database row for sending the info.

View Replies !
Folder List With Pagination
I'm looing for a simple PHP file list program, that will show all the
files in a folder, but show them in batchs of 10 - 15..

View Replies !
How Does One Get A List Of All Files In A Folder?
need a list of all files (i have like 5k or so) in a folder, I need to add there names to a table

I am doing this so i can compare two tables

table 1. comments added to uploaded pics -finished pictures-
table 2. no comments added yet to uploaded pics (so they can be commented on GET IT?)  -unfinished pictures-

All the pictures are in a single folder for the time being i'm going to be making a form based on the pictures that are on table 2 so that they can have comments and titles and file name added to table 1 (to be done still) but i need to know all the file names for the folder in question, i guess i could do it via cmd line ls or something like that, i'll get back to you.

View Replies !
Folder List Drop-Down
I am developing a PHP/MySQL project and as part of my initial setup and configuration scripts, the users can select a skin for the application, and a variable value ($skin) is updated to set the current skin, this works ok on it's own, but currently the user must manually type the skin name in a free-text box.

Ideally this needs to be a drop-down option box, and I would like this to be populated by listing the sub-folders within the '/skins' folder, so that it's always up to date. The folder structure looks like this:

/skins
/skins/skin1
/skins/skin2
/skins/skin3

How can I use PHP to generate a list of the current sub-directories in 'skins' and populate the drop-down list?

View Replies !
Showing Folder List
I have a script where I can move a file and these functions list the folders and subfolders, and I'm trying to indent the subfolders each time. Code:

View Replies !
Retrieving Contents Of Select List On Form Submit
On an HTML form, I have a select list that is fed dynamically with
detail records when the master record is displayed on the form.

There is also a second lookup list, and want to allow the user to
dynamically select from this list and add to the first list. I also
want the user to be able to dynamically remove from and reorder the
first list. I think I can do all of this with JavaScript.

The question I have, is how can I retrieve the contents of the first
list when the user submits the form? I need to get it back into a php
array so I can update and add the proper database records.

View Replies !
List Of Subjects Which Are Links For Bulletins
I am trying to list all the subjects of bulletins for a logged on user. Code:

View Replies !
Automatic Links From Keyword List
does anyone know of a script or code that could search a story posted on a page and make keywords (in my case a players name) automatically into a link. Code:

View Replies !
Parse A List Of RSS Links Through An RSS Aggregator
I am trying to parse a list of RSS links through an RSS aggregator. The links are stored in a text file like this Code:

View Replies !
List All The Links From An Html Page?
Is there a way to list all the links from an html page?

View Replies !
List Of Links From A Block Of Text?
I have a function that parses through a block of text for any kind of link (http://, ftp://, and mailto.. I've tried google as much as I can, and even hotscripts.com, but I can't find what I'm looking for.

Basically what I want to do is parse the block of text for any http:// or ftp:// links, and when it finds them, to put them in an array. Then, I will call the array and have a nicely formatted "link dump" area. I'm stuck though because I haven't the faintest idea how to begin on this.

View Replies !
Dropdown List Of Files In Folder
I am preparing a form that includes a drop-down list consisting of the names of files in a certain folder on the server.

I only need to trap the file name (jpg), not the path and I'm not trying to upload the files or anything - simply allow the user to select one of a number of different image files (they're actually location maps).

View Replies !
Display A List Of Files In A Folder
How do you display a list of files in a folder and then delete one by clicking on it?

View Replies !
List Of My Files Within A Folder / Directory
how can i create a dirlist.php file so i can view just a list of my files within a folder of my website?? So just the files are listed?

View Replies !
Function That Return A List Of Categories In Links
I have a class that has two functions. the first will return a list of categories in links and also attempt to put the category ids from the mysql_fetch_array() function into a new array to store all the ids.

The second function attempts to create a new array which contains the total amount of users assigned to a category based on the array of ids that were previously stored.

Basically in the users table the is a field called cat_id which is the id of the category they are assigned to. So i need to count how many users with the same cat id exist for all categories.

Anyway here is my PHP. The returning of category links are fine, but the attempt at storing the ids is not. I suppose im trying to create a multi-dimensional array?? Code:

View Replies !
Directory List, Identify Folder Different Than File
I need to make the folder from my dir lister point to a link different of my files ?

I'm working with windows NT server... and php 4.3.2

Here is my code :

<?php
$file = $_GET['file'];
if(isset($_POST['text']))
{
if(get_magic_quotes_gpc())
{
$_POST['text'] = stripslashes($_POST['text']);
}
$handle = fopen($file, 'w') or die("Unable to open file for writing");
fwrite($handle, $_POST['text']);
fclose($handle);
}

$text = "";

if(is_readable($file))
{
$text = file_get_contents($file);
}
?>

And later on the page in the html part :

<textarea class="zz" name="text" id="text" cols=170 rows=10 wrap="off"><?php echo $text; ?></textarea></td></tr>

and to add anothe challenge I need it to open in another frame wich is the verticaly siding this one.

View Replies !
Make A List Of All Zones
I want to create a script where the surfer can chose their respective timezones, and then I´ll use the putenv function to display the correct time and date. I know there are timezone information on my freeBSD server at /usr/share/zoneinfo/, but I dont know how to convert that information into useful dropdown menus or lists.

View Replies !
PhpMyAdmin - Obtain A List Of Links Of The Names Of The Databases
I have the following code for index.php and i am asked to edit line 7 to allow access to an array of databases (instead of just one)...Does anyone know how to solve this?

<?php
require_once('lib/DataAccess.php');
require_once('lib/ProductModel.php');
require_once('lib/ProductView.php');
require_once('lib/ProductController.php');

$dao=& new DataAccess ('localhost','root',&#3912;qwaszx','products');
switch ( $_GET['view'] ) {
case "product":
$controller=& new ProductItemController($dao,$_GET);
break;
default:
$controller=& new ProductTableController($dao,$_GET);
break;
}
$view=$controller->getView();
//echo ("<pre>" );
//echo ("</pre>" );
echo ($view->display());
?>

Moreover, i should be able to obtain a list of links of the names of the databases from which i can choose and view the contents of...

View Replies !
Is It Possible To Make This? (Online Signup List)
I'm trying to create an online signup list for jobs in a "restaurant" type thing.  I've got the part where I can get users to login, signup for certain jobs and when the list is full, they can't sign up anymore.  The problem I'm now having is, I now have to create the MySQL table and the php signup page for every day of the year. Is there an easier way to create this? 

What I was thinking was if it was possible to make one signup list and have a constant variable that changes ... actually I have no clue how to get around this.  Could anyone point me in the right direction?  or should I just create all the pages manually, it's possible and I'd have to do it because the project is kinda due soon -_-.

View Replies !
Alphabetizing A List Of Links - Click A Link And It's Not Alphabetized Anymore??
I am editing a site, I didn't make it, and I have a list of links created from a mysql db.  I am sending the info from mysql in asc order, but this only works the first time the page comes up.  If you click on a link in the list, it appears to revert back to being ordered by the date entered and stays that way through subsequent clicks.  A point in the right direction on how to make my list stay alphabetized would be very good. 

View Replies !
How To Be Able To Make A Page Where You Click On A Game From A List
I am making a php arcade script and I need to know how to be able to make a page where you click on a game from a list (generated from a mysql database) then it takes you to a page that displays more data from a table (the game name, category, the code to display the game (thats in a row) and reviews, ect).

Understand all that. Basicly what I have is displaying a list of games from a database, displaying the code to make the game come up, but I need to be able to put the code that displays the game (and other things) on another page (the game page). So how to I do it?

View Replies !
How I Can Make A List That Acts Like A Html Jump Menu?
how I can make a list that acts like a html jump menu (for a regular list I have to use a "Go" button in order to achieve the desired behaviour and jump menus I cannot use because they work only with links to other pages).

For example,I want such a list filled with questions from my db and when I select one I want to see its possible answers; the page stays the same, only its data differs based on the selection. Or you can have a look at such a jump menu on this website, the one with options for geting to various sections of the forum.

View Replies !
Make A Search Engine That Searches A Specific List Of Sites
My goal is to make a search engine that searches a specific list of sites I make(the only example i can think of is something torrentz.com, which searches many torrent sites for a specific torrent) 

I know I could just use Google, but I would prefer to make my own engine in php.  Would it be best to add the info from all the sites i want  into a MYSQL database that updates itself,( i know how to search a mySQL database) or are there some commands I could use to search other websites?.

View Replies !
Get List Of Messages From One Table, Message List Indicator From
I have two tables. One has a list of messages left by users using fields named mbxno for the mailbox and msgno for the message number. I have another table that has mailbox settings for each user that contains a field named "messagelist" to indicate if they want to be included on the message list or not.

What I'm trying to create is a list of the most-recent messages with a lookup on the users table to indicate whether a message in the list should be included in the message list based on the user's mailbox settings.

SELECT messages.msgno, messages.mbxno, users.messagelist FROM messages, users WHERE (users.messagelist = &#391;') ORDER BY msgno DESC LIMIT 100

What I'm getting, though is a list that looks like this:

mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1

I think what's happening is that I'm using the wrong type of join and more rows are being created than necessary.

If I add "DISTINCT" to the query, I get a list of the most-recent messages as I expect, but the "messsagelist" value is sometimes wrong (again, probably because the data is getting jumbled). For example, the messagelist value for the second row (2214) should be 0, not 1.

mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 2214 msgno: 0412141622 msglist: 1
mbxno: 2189 msgno: 0412141408 msglist: 1
mbxno: 0000 msgno: 0412141213 msglist: 1
mbxno: 0003 msgno: 0412141213 msglist: 1
mbxno: 2265 msgno: 0412132029 msglist: 1
mbxno: 0000 msgno: 0412131950 msglist: 1

How should I be doing this? If nothing else, what kind of join will work with a long list compared to a value from a short list?

View Replies !
Produce A List Of Tables Currently Within My Database And List Them In A Drop Down Box.
I need to produce a list of tables currently within my database and list them in a drop down box.

View Replies !
How Can Strip The Text Bullet And Then Make That Copy An Unordered List In The HTML?
I have some text coming into a web page from a MySql DB that contains bullets in the copy. The copy cannot be changed as it is also used in a Quark Xpress document we have connected to the DB. So, my question is how can strip the text bullet and then make that copy an Unordered list in the HTML?

This is what I have but and does the indents like a list but no bullets (I guess they are being stripped by the str_replace as well?

echo str_replace(Chr(13), "<p>", ("<ul>".str_replace('•', '', $bulletcontent1)."</ul>"));

View Replies !
Populating A List Box Or A Dropdown List Using Php And Odbc
I need to populate a list box and/or a dropdown list on a form. I have all
the bits and pieces together, all bar the code which takes the result of a
query and creates a list box.

View Replies !
Mailing List Manager, Send To List
I'm looking for a mailing list script (php) that has a function to let
users to reach out to all recipient on the list by simple send the
email to a specific maillist- address.

Mailman has this functionn but as a just got a webserver account I
can't use mailman nor install it.

View Replies !
Easy Way To Make "pages" From A Database List
If I list all the rows in a database and "LIMIT 20", how do I make it so I can go to, the next 20 rows? Say if I have 50 rows, and only want to show 20 per a page?

View Replies !
List Dir / List Files
Is there a fast way to read files/directory recursively? Instead of inspecting each file(s)/dir(s), is there a way to know that its a file or a directory from its hidden attribut both for windows or unix filesystem?

View Replies !
List To Populate Another List
i have a form with 3 dropdown list. the first is for a canditate, 2nd is for party, 3rd is for state and 4th is for the local areas in the state. I want if the user selects a state, the dropdown list for the local area to be populated automatically. But since they are on the same form i am not sure how.here is my code

<td><select name="state" tabindex="3">
<?php #this is to get listing for roles in a drop dowm menu
#the sql query
$sql1 = "SELECT distinct(state_name) FROM state order by state_name ";
#execute query
$rs1 = mysql_query($sql1, $myConn) or die ("could not execute query $sql");

if ($rs1){
while ($row1 = mysql_fetch_array ($rs1)){
echo("<option>" . $row1['state_name'] . "</option>");
}
}
......................

View Replies !
Getting And Using Contents In A Folder
I want to make a photogallery/slideshow with PHP...

The 'gallery/slideshow' would show up inside a new window.
basically, I just want links with possibility to go:

- forward
- back
- to the very beginning
- to the very end
- away (close the window)

Can I use PHP to determine the contents of the folder with the pictures and then use variables to determine which photo to show, and what URL's should be generates for the arrows? So each folder with a series of photographs would have one PHP file and the pictures themselves in them (it's not a problem to rename them).

Should be simple enough, but I'm just starting out with PHP, and I'd like to have something working as soon as possible... the website I'm working on is about to launch soon (my first 'commercial' web project :) ), and this is about the only thing left that I still have to sort out how to do...

View Replies !
Getting Contents Of Folder
I've made half of the code for a little "hosting" site for a few of the members of my site. Their files are uploaded to /login/<username>/

I'm now stuck as to how to show the contents of the folder in a page. I think the use of fopen() is needed, however the php website is a little confusing.

View Replies !
Contents Of A Folder
I want to put the contents of a folder into an array. Say a folder called data has index.php and text.txt in it. Now I code $files=get_contents_of_folder('data'), and that makes this: $files[0]='index.php' and $files='text.txt'.

View Replies !
Remove All The Links In ($contents)
I have this variable ($contents) which stores a lines of text that may include some words with links. what I need to do is to remove all the links in ($contents). How can I do this?

View Replies !
Delete Folder And Its Contents
is there any way of deleteing a folder and all of its contents using PHP?

View Replies !
Deleting Folder And Contents With PHP
Im using this code to delete a folder using my script but it says Directory not empty. What code could i use that will delete the folder, subfolders, and all its contents.

$currentdir = getcwd();
$directory="$currentdir/users/$_COOKIE[username]/albums/$_GET[albumname]";
rmdir($directory);

View Replies !
Folder Contents Function?
I'm looking for a function that puts the contents of a folder (the file names) into an array. Is there such a beast? For instance, if there is a folder off of my root called /tips/, and I want to list the files that are in it, such as tip1.txt, tip2.txt, etc.

View Replies !
Displaying Folder Contents
I am trying to display the contents of a folder for users to view/download, what is best way to do this? Also, is there a way to "hide" specific files in that folder that I do not want displayed?

View Replies !
Remove Folder Contents
Does anyone know how to detect a folders contents with  PHP and delete all files within?

View Replies !
Show Folder Contents
Is there a function that will show the contents of a folder in the browser? EX:

parent category
file1
file2
file3
etc....

View Replies !
Zipping Up A Folder And Its Contents?
I installed the zip extension for PHP 5.2, but reading the documentation, I can't figure out how to zip up an existing folder.  I mean, I have this folder with a bunch of files in it, right?  I *could* scan the whole thing and add each file to a newly created zip archive, but I don't want to.

Is there any way to tell PHP to zip up a folder and have its contents be everything inside that folder?

View Replies !
Empty Folder Contents
i have a cache folder called "static" i cant figure out how to create a code to clear the contents of the folder Code:

View Replies !
Copy Entire Contents Of A Folder To Another
Situation:

I am creating a folder based on input from a form and then creating an images folder underneath that -- that works great and I can read and write to the newly created folders AS LONG AS IT IS ONE FILE AT A TIME!!!

What I would like to do:

I would like to copy the contents of an entire folder over to one of the newly created folders ALL AT ONCE -- or in a loop -- which is what I am trying to do but keep getting denied.

My code as it is now:
if ($handle = opendir("$sourcedir")) {
echo "Directory handle: $handle<br><br>";
echo "Files:<br><br>";
while (false !== ($files = readdir($handle))) {
if ($files != "." && $files != "..") {
if (!copy($files, $imagepath)) {
echo "failed to copy $files into $imagepath<br><br>";
}
}
}
closedir($handle);
}

all of the variables are working fine... it goes through the loop just fine -- I know this because it prints out the error for every file in the folder... it just won't copy the files over to the new folder while in this loop.

Here is the beginning of the error messages:
Directory handle: Resource id #2
Files:
failed to copy step_c1.gif into /htdocs/www/schemes/adfasa/images
failed to copy step_b1.gif into /htdocs/www/schemes/adfasa/images
failed to copy step_a1.gif into /htdocs/www/schemes/adfasa/images

by the way: adfasa is the folder name brought in by the form and images is the folder I create underneath it.

Is this something that is possible to do in a loop? If so, what is wrong with this one. If not, how is something like this done?

Of course since I know the files that are in the folder I want to copy from I could just go ahead and copy them ONE by ONE but that doesn't seem to be very efficient.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved