Problem With Displaying Folders From Folder
I want to display all the folders present from 1 folder, it works fine and gives me . and .. as directory listing which is not good. The code is as follows:
$path = "../cuz";
$img = opendir($path);
while($file = readdir($img))
{
if(is_dir($file))
{
echo "Folder name is ". $file;
}
}
closedir($img);
View Complete Forum Thread with Replies
Related Forum Messages:
Creating Predefined Folders In A Bunch Of Folder
This can of course be solved with other things than php, but since I write php myself I was looking for a solution using it. The problem is:I have folders set up like this /letter/id/ (ie. /g/132/) What I would like to do is run a one-time operation that creates a totalt of four predefined folders in each /id/ ... The script would have to go through all letters (ranging from a-z) and make these folders in each /id/.
View Replies !
How To Access The Other Mail Folders Besides The Inbox Folder
How does one access the trash and other folders using PHP and pop3? my client program only shows the contents of the inbox (quite naturally I guess coz I always use 'INBOX' with my imap_open() calls. issuing imap_open with 'TRASH' doesn't seem to be ok. can this be done with imap_header_info()...and could someone spare a rough script or pseudo code to do this. can we work with folders using imap?
View Replies !
Displaying The Parent Folders Name
Say there is an url like this for example: www.mydomain.com/pics/b/basketball/index.php using php, is there a way to just display the word basketball in the index.php file? I would also need to display it in the title tags like this: <title>Basketball pics</title>
View Replies !
Displaying All Pics In A Folder
I would like to write a script that displays all photos (jpg) from a folder. I want to be able to load photos into a folder without renaming them and have a script sort them and display them alphabetically.
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 !
Displaying Image From Folder
I want to list all the image file in an array from a directory and then display them such that they appear say, 6 images per page. Can some1 please give me the code to do this.
View Replies !
Displaying Files In A Folder Using A Calender
I have excel sheets generated daily and weekly in this format for filenames..for daily sheets the filename is Jan-10-2002 (mmm-dd-yyyy) and weekly Week-39-2002. I have a script that uploads to a constant folder all the excel sheets. Is there a script that can display the daily scripts in form of a calender. I.E a user can choose to view or download the sheet by choosing the date? Also another for displaying weekly excel sheets in a weekly format.
View Replies !
Creates A Temporary Folder And A File Within The Folder.
I have a PHP script which creates a temporary folder and a file within the folder. I have a problem when trying to remove the file and folder using my FTP program. The ownership and group are set to NOBODY. I cannot change the permissions on either the file or the folder. I have tried chmod and chgrp and chown but for some reason I cannot change permissions.
View Replies !
Remove From $name (folder)/(folder)/[x]/ <-- If Exists To Just Get [x].
I'll be quite honest. I don't have the faintest idea how to do this, while I can do other php without a problem. Once I know how to go about it I'll be okay. It's two things I think? 1. see if there's a trailing slash and delete it. 2. Remove the preceding path to /x, the folders and slashes, and delete them. and then I have x. X by the way is the final folder in a website and this grabs it for me. <? $name = $REQUEST_URI; ?>
View Replies !
File In Folder Above Root Folder
I have a .php script in a folder one level above my website root, and I'd like to include it in pages in various website subfolders, some below the root. Can I use ($_SERVER['DOCUMENT_ROOT'] in the path in some way.
View Replies !
Folders
I have a simple variable: $fulldir = 'photo_upload';but when I moved the script that this variable is in, the adress should be $fulldir = '../photo_upload'; But this is giving me a error, what would be the correct way of specifing the directory ?
View Replies !
Uploading Folders
Is it possible to upload entire directories from a form in such a way that a user can browse to the folder on their local machine and select it for uploading or synchronization? I am using php5.
View Replies !
Reading Folders
If I had several folders full of images, how can I get PHP to open the folder, read the image names and save the image names (inc extension) to a MySQL database? What I am trying to do is create an image gallery using PHP/MySQL, so that everytime i take a load of pics, all I would have to do is get PHP to read the contents of the folder and add the filenames to a MySQL database rather than having to manually input the names into the database
View Replies !
Gziping Folders
I'm using PHP and Gzip off the server to gzip up some files. If I select individual files, everything is fine, but I can't figure out the syntax to gzip a folder. $zipfile=shell_exec("gzip -9 test.html"); That's what I'm using for a file. But how do a zip a folder?
View Replies !
Protecting Folders
I have a data driven website. Part of the website is a downloads section - all the downloads are help in a folder called "downloads". When a general user (i.e. one that doesn't have a log in) uses the site and access the downloads page they are given a list of general downloads. When a member who has logged in uses the site, the same page presents the general downloads and the member only downloads. This all works fine. A slight hole in this security, however, is that the downloads folder is not protected. I have moved the member downloads into a subfolder within downloads. How can I protect this so that only people who are logged in can access it - so that general users cannot accidentally browse it or make a direct link to the documents within it?
View Replies !
Sorting Folders
I have a site with photo-albums on it. Each directory represents an album. What i want is on the "home page" of the site a feature which says "newest album: *******" So i have to search the album directory, and then sort them by date. And then it automatically has to grab the newest album. Maybe a slight problem is that the albums are divided over 4 subcategories. (Match, players etc.) Match: - Match 1 - Match 2 - Match 3 Players: - player 1 etc... Albums would be 'Match 1', 'Match 2', etc. hope ypu understand.
View Replies !
Files And Folders
I need to display images on the site. Every image is being stored in its own folder. Folders are updated daily. I need to display a list folders (like FTP), and when a user clicks on a folder name, it will show them other folders inside the parent folder, or if there are no more folders inside picture files will be opened. I know how to get a list of files and open them when I am in a current folder. PHP Code:
View Replies !
Images In Folders
I'm a newbie and I need a good starting off point. Basically is there a way in php where you can call up all images (jpgs and gifs) within a directory. Also is there a way to format the images to come up in rows. Hope this makes sense.
View Replies !
Find All Folders
I've been looking around and I can't seem to find a function that will allow me to open a folder and read all the folders inside it.
View Replies !
Creating Folders
im in member.php which is inside a folder called 'member' i have a folder called 'collection' which is outside this member directory. i want to create a folder inside the 'collection' folder based on the username, e.g, $_SESSION['Username'] . "_images"; so that will be like: john_images folder. i want to actually check if the folder 'john_images' doesn't already exist though. can soemone please show me how it can be done?
View Replies !
Cookies With Different Folders
I have 2 pages that save cookies, and one is in a folder called "myevent" (mydomain.com/myevent/) and the other is at the root of the website (mydomain.com/) Is there any way to get the same cookie to load in both the folders? here is the code I use to save them: setcookie("contNumber",$_POST['txtContNum'],time()+60*60*24*30,"","mydomain.com",0); setcookie("emailAddy",$_POST['txtEmail'],time()+60*60*24*30,"","mydomain.com",0);
View Replies !
Counting Folders
I am looking to call a function that will simply report a 3 numbers back as variables. 1st variable returned: number of folders created in a given location either today or yesterday. 2nd variable returned: number of folders modified in a given location either today or yesterday. 3rd variable returned: total number of folders in a given location again I do not have the function wrote, but just an example what I would like to accomplish example of what I would like to call would be: Code:
View Replies !
Passwording Folders
you may have seem my last post "Passing a file to a funcion without user input" well I thought I'd got it working. It does everything I want it to apart from work :-(. It makes the file and copies it into the right place, but the passwords don't let me in. Code:
View Replies !
Accessing Folders
I want to be able to read and then display files in php (files based within a folder within our web root folder), is there a way in which php can do this directly? They are going to be saved html pages and I want to be able to list them so users can view them.
View Replies !
Cookies In Folders
I've set a cookie, which is working fine, but it's only accessable from the folder of the page I set it in (in this case the admin folder). I didn't specifically tell it to set in that folder, but it only works on files in there. I need to be able to access it from all folders in the site. What am I doing wrong?
View Replies !
PHP Security In Folders
I have programmed several PHP scripts which write and remove files over "EMPTY" folders and only accessed by these PHP scripts. I would like to know what is more secure: To enable permissions of these folders with chown nobody/nobody (how is running my PHP) and chmod 644 or To enable permissions of these folders with chmod 777 and chown user_name/group_name (namely the default UID and GID of my site).
View Replies !
Folders To Subfolders
This code takes a direcrory and adds it to a .tar. I want it to go through and add subfolders underneath the directory as well. Ill post up tar.php if you need me to. <?php include('tar.php'); $new_tar = new tar(); $directory = 'the_directory' $new_tar->addDirectory($directory); $d = opendir($directory); while (false !== ($entry = readdir($d))) { if($entry != '.' && $entry != '..' && !is_dir($entry)) $new_tar->addFile($directory.'/'.$entry); } closedir($d); $new_tar->toTar('myTarFile.tar', false); ?>
View Replies !
Virtual Folders
I can't get file command like file($fileName) and file_exists($fileName) to work with a file stored on another server and accessible through a virtual folder. /resources/ is a virtual folder pointing to a location on a remote server that is accessible via network, file_exists("/resources/tmp/test.txt")src = "/resources/tmp/test.txt" however does work oddly enough.
View Replies !
Protect File Folders
How do I protect file folders like "stylesheets" "php scripts" etc, from exposing their directories to the public? If a visitors would come upon these folders, they would be able to see the content of the folder, and view the documents.
View Replies !
Automattic Folders Question
Would it be possible to do the following? and if so , any body have any ideas where i should start. I want to allow users of a web site to create a page (index.php) inside of a folder that is the name of their company so : X Y Z Company would be: http://www.domain.com/X Y Z Company/ or should it be:? http://www.domain.com/X-Y-X-Company/ and i would want index.php to be inside of those directories so that a user could log in and change the information on index.php through a certain amount of form fields. The hardes part i think will be creating the directories on the fly if a user signs up for a site. the index.php page will be simple b/c it will just query the database and then pull the info from the URL.
View Replies !
PHP Access To .htaccess Folders
I've a folder which holds image (.gif/.jpg) files. the folder has been .htaccessed to prevent direct URL access. However, this also prevents my php codes to make calls to this folder. the following proposed solution does not work: 1. putting the image folder outside my root directory - i don't have access to the root directory 2. having <directory> codes </directory> in .htaccess does not work - it blocks everything.
View Replies !
Dealing With Folders/paths
When I develop a site I normally develop it within a directory from the domain name. Example if I was developing a site at http://www.dogs.com I usually would have my development work in a folder located at http://www.dogs.com/jeff/ When I code re-direction links for headers I then do this: Code: $link = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/enquiries.php"; But then when it comes to moving the site to the root of the domain, the re-direction link creats an extra slash(/) to the link being created because there is no sub folder. How do I tacke this situation automatically instead of manually changing all the link variables without removing the dirname($_SERVER['PHP_SELF']).
View Replies !
Copy Files And Folders
Assuming you had a template folder and files on the webspace and you wanted to make a exact copy/rename of it with a username and password being the one and only difference - how would one do it ? . (the difference being a password protected folder)
View Replies !
Uploading Images In Folders
Does Anybody know a good script to upload images to a directory with different folders inside.. I want users to be able to upload it to the folder that they choose or create a new folder within the dir IMAGES. The script can only accept JPG, JPEG and GIF extensions.
View Replies !
Using Files/folders To Create A DB
I'm always looking for ways to decrease the amount of time I spend adding records to my database. I was thinking about this today, and wondered if it was possible.... I want a PHP script to open a folder or folders, read the files, and make a record in the database for each file. For example: Folder 1 contains the files--4000out.jpg, 3000bcr.jpg, 4000btcf.jpg, etc... When excuted, the script would create (in this case) three records. I only want the script to do the base work, I will add what can't be done to the records later. Also, in the case with mp3's. I'd like the script (or a seperate one) to insert each record using the ID3v1 tag info. I'm familiar with open files and folders...but haven't come across any tutorials or scripts that do this. So...is this possible?
View Replies !
Securing Folders With Php Linux
I am creating a site in php on a dedicated linux redhat server. Users will sign up to the site and get the own url/folder www.mycompany.com/username They will be able to store files in their folder/url Can anyone give me any idea how to secure the folder so that only once logged in people can access the files in the folder. I want to stop anyone from being able to go to www.mycompany.com/username/file1.doc and being able to download it. I am using MYSQL 5 and PHP 5 and the latest version of Redhat Linux.
View Replies !
Cannot Delete Folders After Mkdir()
I am using php to make a directory (to store all of the users files for the site), and it works fine mkdir("/home/fullpathtomyserver/public_html/users/$users_id/", 0777); It makes the folder just perfect, BUT there is a flaw. The folders it creates are un-deletable. I can browse them, and even link to files within them, but I cannot delete them at all. I have tried deleting them through FTP and cPanel's File Manager,
View Replies !
Copying Old Folders To A New Location
I'm trying to write a page that would make a copy of a set of folders to a new location for an intranet. There is lots in the page for debugging that would vanish once I get it to work. The problem I'm getting is I cannot get XCOPY to work. Other dos commands work fine. Code:
View Replies !
Session Not Working In Folders
We just moved a script to a clients server. We developed in PHP 4 and everything worked fine. The clients server is PHP 5. Sessions work perfect when its in the main public_html directory. When a user goes to a folder ie oursite.com/folder/ the session is no longer there. Is there any changes in the versions that would cause a session to no longer be valid when you enter a folder?
View Replies !
Hide File And Folders?
I just installed php apache and mysql on windows xp platform. i had a small problem, when i type localhost in the browser it dispalys all the folders and files, i would like to hide all this folders from praying eyes and direct the user to index.php. Is there anyway i could restrict the display of files and folders when user type localhost and redirect themto index.php.
View Replies !
How Many Folders Can Apache Hold
how many folders can apache hold in one directory ? Im useing linux. It didnt occur to me untill now, im writeing a script that uploads files and gives a user a link to download it, and each file is stored in its own folder with a unique ID. But now its occured to me that this may become a problem in the future.
View Replies !
Counting Folders And Files Within Them?
i'm working on a project and I'm having trouble figuring out my next move. I have image galleries setup in a folder directory like so: top directory | -Gallery 1 -Gallery 2 -Gallery 3 and so on. I've got about 25 galleries total. What I'm trying to do, is count the number of folders (Galleries). That is my first main problem. Second, I'd liek to count the total number of files within all of those combined folders. I know how to count files within each separate folder, and i suppose i could just use the sum of those, but is there a separate, easier way to do that?
View Replies !
|