List Dir And Files In Sub Dir
I am trying to make a script that list all of the files in a directory and then if the file in the directory is a sub Directory it will list the files in the subdirectory.
If anybody would have a clue how to do this or where to start, please tell.
Also in the end i want it to check file dates and delete them if they are older then 3 days, but i dont have a clue where to start on this.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
List Certain Files In A Dir
I am working on a news script were my members can post what they are currently working on. I have a dir were all of there images are going to be uploaded, and I need to know if the following is possable to do. $username = the members name selected from the database $projname = the projects name selected from the database What I want to do is select only images with the filename containing the info. The filenames are like this: TheBlackshinobi_3dmountain_1.jpg TheBlackshinobi_3dmountain_2.jpg TheBlackshinobi_3dmountain_3.jpg
Php Foreach Dir List Files In Dir
I've got some code to loop through a directory and it's sub directories and bring back a list of files and folders. What im wanting to do is have this in a state where i can put all info into a database so i can quickly index and then see what files are in what folders. It's all my security camera triggerd avi files. The following code will loop through an give me an array of files and folders Code:
Get A List Of Files On A Website
I need to get a list of all files in a particular virtual directory on a web site, such as - http://www.myServer.com/FileStore I tried using the directory functions, but this doesn't work. if($dirHandle = opendir("http://www.myServer.com/FileStore/")) { while(false !== ($file = readdir($dirHandle))) { print($file."<br>"); } } closedir($handle); } Is there a way to do this?
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.
List Php Files In Directory.
I am creating a plugins folder that I will use to store php files. I also store other folders within that "plugins" folder. The problem I have is getting the script to read only the the .php files and skip subfolders. Plugins[main folder] ->plugin1.php ->plugin2.php ->screenshot[folder] ->downloads[folder] How to keep the script from checking the folders (screenshots, downloads..) This part of my script filters the main folder and parent but not subfolders if ($file!= "." && $file!= "..") { How do i get that code to not check subfolders.
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).
How Do I Edit A List Of Files Associated With A Product ?
-I wrote a script that you use it to add products in the database. -Each product is associated with files. -In the Form to add the product you have to enter the product name in a textfield and below there are $no_of_add_file filefields. $no_of_add_file is an integer that determines the Maximum number of filefields that you want to associate/add for each product. So it succesfully adds the product and the files in a database and the filesystem. The problem I am trying to solve is how am I going to edit those files in the product. If you know what I mean... and you have done something like that or you know a url or script that does that, pls let me know. What I need mostly, is not the PHP code but the logic and what are the possible ways of doing something like that. In the database i have two tables that this script needs: One is the products and the other the files. Products : product_id, product_name Files : file_id, file_name, product_id
Generating A List Of Files On Another Server
I have been messing about with the folder / file functions on the php.net website but they all seem to be for local folders. All I am trying to do is generate a list of files on another servers folder - so my variable to generate a list from would be "www.tnauk.org.uk/bbs/daily" but the script would be running on nimmox.com. Is it possible?
List Files In Directory Excluding Directories
I have the following code which I require to get the list of files in a given directory. However in that given directory I have other directories as well. I thought the second if condition was taking care of excluding the directories, but its not. I get a bunch of directories listed along with the files. PHP Code:
List Of Files Fetched Via Include() Or Require()
I want to be able to, at the end of an executed file, summarize what files it included and required (via include() and require()). I have a very dynamic script that depending on the situation handles several different files and scripts. To aid in developing, listing them would be helpful, to troubleshooting problems. Iss there a way to list all the files that have been included along the way?
Create PHP Pages From List Of Files In Directory
this is probably easy for a php pro... but I cant figure it out.. I have a directory of mp3 files named like this. Chevy_Car_Commercial.mp3 There are about 150 files. I am trying to find a script that will make php pages based on the file names. chevy_car_commercial.php And also dump that variable title Chevy Car Commercial into the <title> of the web page... I have made dynamic pages before... but that was using a form..
Ereg, Read The Dir And Print List Of Files.
I have a dir of html files that link to websites, i would like to read the dir and print a list of those files as a link. Which the script i have does. I would like to take this one step further and replace the ".html" extension with ".com" so it winds up being:
List Files In Directory For Apache Alias
I want to list the files in a given <dir> with a given file extension ... opendir() or scandir() would seem to be my solution. BUT! those files are outside the root dir of the site ... accessed via an apache alias. so opendir() and similar functions do not seem to work as I cannot feed it a relative path. is there a way to do this? my page: <http://myintranet/prodinfo/listdir.php> http location of dir to be listed: <http://myintranet/dailies/> /dailies/ is an alias pointing elsewhere on the server. indexing has been turned on for this alias in apache, so loading the above URL shows the dir contents by default. so for example ... this works because /images is in the root of the web dir: $myDir = "../images/"; $scanFiles = scandir($myDir); print_r($scanFiles); this does not work as dailies is an alias and not a dir in the web root: $myDir = "../dailies/"; $scanFiles = scandir($myDir); print_r($scanFiles); one option I see is to grab the html of that apache auto-generated index page and parse the content to grab the links out of it. but this seems rather roundabout, and with all the great php file tools, I'm hoping there's a much simpler way. does anyone have any ideas, or is there some addtl info I can provide to make my question clearer?
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.
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 = Ƈ') 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?
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.
Including Files In Different Direcories That Include Files From Teirs
Okay, I made a simple AJAX shoutbox and I want to include it on all my pages. To insert the shoutbox I simply type <? include('/shoutbox/shoutbox.php');?> into my HTML page. The problem is, that in /shoutbox/shoutbox.php I also include settings.php, functions.php, and some other files, and when I include /shoutbox/shoutbox.php into my index page, /shoutbox/shoutbox.php tries to call settings.php from the same folder that my index file is in, since I just 'included' it in index's source. So my question is, is there any way, without using frames, to include a PHP file as it would be if you link directly to it in the address bar, but placed into another file in a different directory?
How Do I Hide Database Connection Files Using PHP Include Files?
I have the following at the beginning of the PHP page: <?php require_once('Connections/conn.php'); ?> I want to hide the connection file, "conn.php", so it's out of the web accessible file structure. I understand putting them in the php include directory shoudl do this. For example, let's say the directory I put them in is /www/phpIN/, and /www/ht/ is the root web directory. So I put "conn.php" in the inlcude directory (/www/phpIN/conn.php) and removed it form CONNECTIONS directory.
How Do I Hide Database Connection Files Using PHP Include Files?
I have the following at the beginning of the PHP page: <?php require_once('Connections/conn.php'); ?> I want to hide the connection file, "conn.php", so it's out of the web accessible file structure. I understand putting them in the php include directory shoudl do this. For example, let's say the directory I put them in is /www/phpIN/, and /www/ht/ is the root web directory. So I put "conn.php" in the inlcude directory (/www/phpIN/conn.php) and removed it form CONNECTIONS directory. Now it doesn't work. What do I need to change?
Creating Dir, Copy Files And Pass Variables To 2 Files
I need to create a folder on the server weekly named by the user. To this folder copy the contents of an /Original folder. Inside the new folder edit one of the files to insert a data with a XML path generated in another application, copied (via memory) and pasted within the very first form and passed to the file in question. <param name="FlashVars" value="xmlfile= $lanofile" /> the $lanofile is the value that I need to pass from the form to be read by this file. I have created an form (n.php) that POST the name of the folder to a second file (creatdir.php) everything is cool until I have to edit the third file. How can I pass the value of one of the formfileds to a second file and them read this value as a variable to be consumed as mentioned above? Or actually right whatever is on the third field to this position (not using variables).
Upload Audio Files Of Type .wav & Video Files Of Type .avi
I need to upload audio files of type .wav & video files of type .avi / .mov but my current file unloader is not helping me with that. My unloader works with application types, images, txt, pdf , mp3, mpg, mpeg but not with those .wav & .mov/.avi files........
Files Inside Files
im creating something new with alot of php files, and i remembered that alot of times on message boards and things like that you see like "misc.php?action=list" or something like that. i would really like to decrese the amount of files i have for this new thing im creating. can someone show me how to put multi files in one?
Using List
when my form is loaded i populate a list with a database query. now when user selects a value from the list. on "onChange" another query runs and other fields on the form are populated according to the value selected by the user but at this time when page is loaded again and the fields on the form are filld. every thing goes write but the select list doesn't have the same value selected that was selected by the user...the selected list shows the default valuse selected instead. i want to know that how can we do this that when we select a value from the list and page is populated using this vale and refreshed then again i want to see the selected value in the list box not the dafault value.
Mp3 List
I can't figure why I can't list only mp3 files with this code : <?php $dir = opendir("."); while($file = readdir($dir)) { $ext = getFileExtension($file); if ($ext = "mp3") { echo "<a href=" .$file.">".$file; echo "<p>"; } } closedir($dir); function getFileExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } ?>
Buddy List
I have a community, now it´s time to upgrade and make a buddy list. Ive started wtih the file that ask´s the other member for a relation. The code looks like this PHP Code:
Problems With List()
I am having some problems with the list() function. Here is some code: <? $USERDB = fopen("users.db", "r"); while ($line = fgets ($USERDB, 4096)) { list ($name, $occupation, $favcolor) = split ("|", $line); print ("Name: $name<br>"); print ("Job: $occupation<br>"); print ("Favorite Color: $favcolor<br>"); } fclose ($USERDB); ?> And here is whats in the text file: Van Tate|Software Engineer|Green Now...when I execute the script I get this error: Warning: bad regular expression for split() in /var/www/html/v2/getusers.php on line 7.
List Constants
A little embarrassing but: is there any easy way to echo (the name and value of ) all defined constants?
Drop Down List
I want to read a directory for available files and then get the filenames and put them in a drop down list. Whatever the user will select will be the value of the variable $selected. I already found the code to read directories: Code:
Loop Through A List
I want to loop through a list and display it in a table with three columns per row, yet haven't had much luck in doing so. I was thinking if would be something like so Quote: for ($x = 0; $x < mysql_num_rows($query); $x++) { if ($x / 3) { ?> <tr> <? } ?><td> Blah </td></tr></table> Well, that's as much as I know so far.
Add Number In List
I am outputing a list of 10 values. 10, 20, 30, 40, etc I can add 15 to one of the values then reorder the values from smallest to highest but i want to update every single value and assign it values increamenting by 10 so after the update the second number of 20 and add 15 I get 10, 30, 35, 40 now i want to re output the values above as 10, 20, 30, 40
Php Mailing List
Can anyone point me to a php script that stores email addresses into a txt file? The purpose for this is for a mailing list, ideally if a user wanted to unsubscribe the email would be removed from the text file.
PHP Link List
On a page from Thredz (http://www.thredziii.com) I saw a script (it's not on anymore...cause he didn't want the script to be on his page) and I love it... It's a script that makes it possible that on a page links are sorted ALPHABETICALLY with the first letter of the "URL name"... (take a look on Thredz' site to c what I mean,K?) Then people got 2 have the abbility to fill in a small form, ON THE SAME PAGE WHERE THE LINKS ARE ON, where they fill in 2 fields; #1 = Name of the Site ($sitename) #2 = URL of the site ($url) When they fill out it form I want the PHP-script to put the information away as a link (in a *.txt-file...if possible) <A href="$url" target="_blank">"$sitename"</A><br> (something like this??? I'm not sure......) These links have to be sorted alphabetically (on the site's name,$sitename... I don't know how this works or how I have to make something like this... Could somebody please help me and give me a bit of help with it? Some explaining would be gr8 but the script written for me is the best wish I have.
Dropdown List
I have a Dropdown list with Select with 1, 2, 3, 4, after select on of them it bust to refresh the page to what you select but it don't do it. PHP Code:
Getting List Of Newsgroups Via Php
I am trying to write a PHP script that will download a list of all the newsgroups on a news server and put them into a MySQL database. I bought a $50 book that had some NNTP examples in it, but none of them show how to just download the groups, not the articles. I tried on my own for about 2 hours with no luck. If someone can point me in the right direction to download the group list using PHP, I think I can figure out how to write it to a database.
FTP List Problem
I used ftp_rawlist, not ftp_list. [color=blue] > I used ftp_list and ftp_nlist. Both of them worked when the target is Sun > or Linux machine. However, it didn't work when the destination is VXWorks > (embedded platform). The version of php I am using is 4.3.2. According[/color] to[color=blue] > my search on google that problems for ftp_list and ftp_nlist for some > platforms were fixed in 4.3. > > If I manually ftp to the VXWorks, I could use the "dir" or "ls" to see the > listing at the destination. >[/color]
Php And Drop Down List
I am coding an email form on a site. A user enters their name and contact email and then selects from a drop down list to which particular email the message should be sent: User1, User2, User3. Then the user types out a message and hits submit. My problem is that I am unsure as to how to grab the selection in the drop down list and pull the selection and place it like this: "$selection@domain.com". Here is the php code:
PHP Shortand List
Is there a place where I can find a list of all the shorthand/shortcuts in PHP's syntax. IE: $_POST, $counter++, etc? Anyone know?
Getting A List Of Newsgroups With PHP
Does anybody know of a quick and dirty way that I can connect to a news server, retrieve a list of all newsgroups beginning with alt. (or comp., or blah., or wibble., doesn't really matter), and also the newsgroup descriptions, and then dump them all in an html file?
Php Mailing List
Is it possible to implement a mailing list using PHP?. I know I could maintain a list of emails addresses in a db and send mail to them through my website, but how can I get true mailing list behaviour where emails are sent to a particular address (like mailinglist@mydomain.com) and then distributed to all of the email addresses?.
While(list => Checkboxes
I wanted to print out checkboxes for those which are checked when form is being submitted. Whilst, this is my function: PHP Code:
Select List
I'm creating a form that has three select lists. The first one has two values EMAIL and SMS. What I want to do is have the two other select lists (named EMAIL and SMS) work so that if EMAIL is selected only e-mail select list can be altered and vice versa with the SMS. How can I do this? I know to use disabled in <select> -tag, but how can I check the what the value is (and the value changes) and then act acording to it?
Best Way To List Pages A - Z
I now have my emulator site up and running, no longer html but php! Even my vote script now works, thank for all your input. Now I want to have roms on my site for download, but it's a fair long list so you have to devide in sections a - z or something. Can this be done in a way to create those pages with php/mysql instead of have to write html files for every emulator roms page from a to z? If anyone have done this before I would like to here what the possibilties are.
How To Use A Value From A Pick List?
I'd like to have a form that does the following: User picks a site from a dropdown list from a MySQL db (that works - code below, thanks to all those on the web who posted code for this). Once the value is selected, a second query is run using the site as the 'where' clause and the results are displayed back to the user. mysql, php, htlm noob. I think once I get this bit, I'll be able to move forward with more interesting and complex code. ps - if this message shows up 3 times, my apologies but I've been having trouble posting. <html> <body> <?php // connect to db $db = mysql_connect("localhost"); mysql_select_db("test",$db); // build query $sitequery = "SELECT site from sitedata order by site"; // generate result set $siteresult = mysql_query($sitequery); // use results echo "Select a site from the list below: <br><br><select name='site'>"; while($siterow = mysql_fetch_array($siteresult)) echo "<option value='".$siterow["site"]."'>".$siterow["site"]."</option>"; echo "</select></td>"; ?> </body> </html>
Css List Navigation
I found a nice link about CSS liquid layout. Specially for css list navigation ....
How To List A Directory
I would like to get a list of a local directory content using php. I would be very appreciative if anybody could tell me how to do that. I loocked in the php manual but coulsn't find anything (probably I just missed it).
|