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 Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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.
Creating Pics On The Web
I am developing a claims input form. part of this form, the original paper version, was to draw a brief picture of the accident. Is there anyway in PHP, or other addied controld to achieve the same result.
Watermark On Pics
I need to add a watermark on the photos that are generated. Any ideas how? Do I use the imagepstext() function? PHP Code:
2 Pics In Layers
I have a site where I have pictures and frames for the pictures. Is it possible that user picks a picture (it opens in same or a new window) and then picks a frame (which is added to the border of the picture selected) to see how it looks. There will be different pictures and frames. Any idea of how this can be achieved, if not in php, some other way?
Retrieve All Pics From Url
I want to get all pics (.jpg) from a url and I use this code but sometimes with some urls it doesnt work :( Anyone can check it out? $text = implode("", file($url)); $text = eregi_replace("<!--([^-]|-[^-]|--[^>])*-->","", $text); while (eregi("[:space:]*(img)[:space:]*=[:space:]*([^ >]+)", $text, $regs)) { $regs[2] = ereg_replace(""", "", $regs[2]); $regs[2] = ereg_replace("'", "", $regs[2]); $regs[2] = preg_replace("/(s.+)/" , "" , $regs[2]); if(eregi(".jpg|.jpeg|.jpe",$regs[2])){ echo $regs[2]."<br>"; } $text = substr($text, strpos($text, $regs[1]) + strlen($regs[1])); }
Resizing Pics On The Fly With NetPbm
I need thumbnails to be dynamically and instantly created on the fly. My server supports GD and NetPbm. I tried a program that uses GD but the pictures looked aweful! Is there a way, using PHP and NetPbm that I can call an image like this: <img src="thumb.php?image=pic.jpg&height=20> So that a 20 pixal high jpg thumbnail of pic.jpg is returned?
GD Not Outputting Pics But 'sourcecode' Of Image?!
I've used GD before on other servers and haven't had any problems with it.. But now, on a new project, I want to make dynamic title graphics and for some stupid reason it's only outputting the source of the image, like so: Code:
Looping & Reference To Db - Insert Pics At Intervals In Text
I have a page that displays an article from a table named articles -- clever, huh? -- and the relevant fields are text, photo1, photo2, photo3 etc (up to 6). What I'm doing is breaking up the text by line breaks into an array and then printing the items but after an interval of 3 line breaks, an image is inserted from the fields photo2, photo3 etc as long as the photo field is not empty. The first photo field is auto-entered in the HTML so is skipped for this code. Now everything is going OK except that for some reason, the reference to the photo fields are ignored and nothing is printed. I've tried the following code as well as another version where the array of photo fields is created outside this loop, however, either way, the call to the db does not work from within the loop for some reason. Code:
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; ?>
How To Get Folder Name Out Of
An easy one for somebody, but I have not got my head round it yet. I need to get the folder name out of a URL ie: /support/desktop/documents/general/fa95e9e698c76fdc606f3b94fe89b48b/17_Import_data_en.pdf $folder = fa95e9e698c76fdc606f3b94fe89b48b;
PHP 5.2 Doesn't Have Ext Folder?
I just downloaded and installed php v5.2, Apache 2.2 and mysql 5.0.27. I'm having the same problems as many regarding the "undefined function" error and am trying to work through it, but I'm noticing (via many of these troubleshooting tutorials) that people are talking about an "extensions" folder and a php-recommended.ini file and the such, and I notice that I don't have either in my installation of 5.2. Did I download the "preferred" installation package? The one I downloaded is called php-5.2.0-win32-installer.msi. I'm coming from a php 4.4.2 apache v1.3.31 and mysql v4.0.20a - all of which was lost during a major crash so I have nothing to compare these 5.2 files against. If I've downloaded a "non-preferred" installer, could someone tell me which one I should install to get everything working properly -- or at the least to have a complete package.
Folder Name As A GET?
I currently have a website and would like to be able to give my members an alias to access their profile. At the moment, people have to go to something like www.domain.com/viewmember.php?id=3456, which isn't practical unless it's through clicking links. I'd like to be able to give my members the ability to use something like www.domain.com/myname, which would then forward to the correct page. The problem I can see is that the server thinks myname is actually a folder and returns a 404 error. Does anyone know of a way to do this?
Check For Folder
how would i check if there's at least one folder in the current folder? the current folder is $dir/$f/ this is what i have, but i know its wrong $fillle = "$dir/$f/"; if (file_exists($fillle)) {$Q="true";} else{$Q="false";}
Folder Retrieval
I have managed to retrieve a list of pdfs that are in a folder and displayed them with a link to a new window: <?php //RETRIEVES FOLDERS CONTENTS $dir = "/var/www/html/bbcl/building/projects/pdfs"; $folder = "/bbcl/building/projects/pdfs/"; $handle = opendir($dir); while ($file = readdir($handle)) { if ($file != "." && $file != "..") { echo "<a href="$folder$file" target=new>$file</a><br>"; } } ?> But it also display's the name of folders that live there, anyway of specifing what file extensions to appear in the list?
Rename A Folder
Is there an easy way to rename a folder? A function I am missing?
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...
Size Of Folder
how i get the size in k of a certain folder on mysite, i know i've done this before but can't think of what to look under at php.net.
Current Folder
Does anyone know easy way to find out the current folder where the script is? I tried to this but it doesn´t work in my Linux web-server, but it works in NT-desktop. $dir1 = getenv(PATH_INFO); $last = strrpos($dir1, "/"); $dir2 = substr ($dir1,0, $last); $name = strrpos($dir2, "/"); $folder = substr($dir2,$name+1,20);
Folder Permission
I have a problem when i create a folder using the following php code: <?php mkdir ("foltest/bleh", 0777); ?> The problem is that the folder "bleh" doesn't have the 777 permission like I wish it did, but it has 755 instead. Is there something wrong with my code, or could this be caused by my host?
Folder Browser
I'm looking for some sort of php folder browser - basically if i have the following folders; index index/welcome help help/email help/web docs in one pull down will display the folders index, help, and docs - where as menu 2 will display the folders that lie in index, help or docs.
The Root Folder
I've a web site in the address http://mySite.com in the root, I've a file index.html I've some subfiolders insid root/sub1/sub2 I like to add an html file (or php) index.html that call the index.html of the root (in order to protect) Now I've created 2 different index.html because I use relative path to design the root (../index.html and ../../index.html) I like to have the same file in all folders,but I don't know how to call the root folder.
Folder Permissions
My trouble might be simple, but I'm quite new to php, and, perhaps I'm even more simple. It's that I had to chmod 777 two folders to get my scripts do what I wanted them to do, and I don't like it. I have a script running on my ISP's unix-apache -server. It is to read string from a form, and create a text-file in a subfolder 'txt' from it. The essential parts of the script is here: $fnam=$HTTP_POST_VARS[filename]; $handle =fopen("txt/".$fnam, "w"); $teksti=$HTTP_POST_VARS[tekstikentta]; touch('txt/'.$fnam); fwrite($handle,$teksti); fclose($handle); Can't be simpler. This script didn't work until I did a chmod777 for both folders, the one where this script is, and the 't' subfolder. Is there a way to get around this?
Folder Loop
i have a folder called "profile_images" how do I loop through the images in this folder, and echo each filename guys?
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.
Getting The Size Of A Folder
All Ive been trying to do is make a short php script (embedded in the html, no separate file) that simply displays how much space, in megabytes, the contents of a certain folder is taking and use an echo command to display it. I've tried the filesize command and it always gives me 4,096 regardless of the contents. I assume this is because PHP is taking the size of the actual folder. I've tried disk_total_space but this displays a number that is completely off.
Delete Folder FTP
I am trying to delete a folder and all of its contents (folders, files) through ftp. I am trying to modify a script for deleting it locally. I don't get any errors with this, but nothing happens. Can someone point me in the right direction? Code:
Deleting Folder
is there anyway of deleteing a folder and deleting all of its contents with it? i know that with rm_dir needs to folder to be emptied
How Much Space A Folder Is Taken Up
How is everyone? Well I was just wondering if somebody got teach me how to make a PHP Script which tells you how much space a folder is taken up? Example: I have a folder called ./files, I want a script which will tell me howmuch space its taken up .
Check If A Folder Contains Anything
what do I use to check if a directory contains anything. For example how do I check if there is anything in this? (Which in english is something like news/download/may2007/document1.doc UPLOADS_PATH.'/news/download/'.$oDownload->download_path.'/'.$oDownload->download
Copy Folder?
I want to copy a folder, subfolder, files, and subfiles. I don't care about attributes. I thought about making the folder a zip, and then using extract but that was confusing and took too long on the server. so what do I do? Is there a script that will parse the dir and COPY all the files?
Folder Permission 777
I need to upload pictures for a photo gallery but in order to work the upload, the folder's permissions must be 777. ( or am I wrong?). chmod 777 as read thousand times is not secure so what can I do? Check if the folder and change the permissions before and after the upload? Is this secure?
INCLUDE'ing To A Different Folder..?
I've got a file structure -www (containing normal site files) -www/inc (containing includes like db.php, session.php etc) -www/accounts (containing an area for customer login) I'm working on www/accounts/signup.php and am trying to use the following code: <?php include "/inc/session.php"; ?> ...so that certain session elements can be set. however, I'm getting an error Warning: include(/inc/session.php) [function.include]: failed to open stream: No such file or directory in E:XAMPPxampphtdocsmysiteaccountssignup.php on line 3 (I'm using Xampp as a testing server as well as my live server) - I've tried various combo's of paths to the sessions file, but the server is not allowing a proper include to it.
Upload Folder
I have this code: $uploaddir = dirname($_SERVER['SCRIPT_FILENAME']) ."/Images/"; and it uploads the image to /admin/images/ as the page i'm running it from is in the admin directory. I've tried just using the http:// and it doesn't like it. Could someone please tell me how i can make it upload the image to /images/ instead of within the admin folder.
How To Protect A File Or Folder?
I want to protect my URL How to realize the following function? Users click on the URL, a login htm page appears. Users enter username, password and click on the submit button. PHP file consults mySQL to get username, password and registration date. If user account is valid, user may download this software.
How To Delete An Undeletable Folder!
I run PHP5 and was testing a script to allow users sampling a demo script But to keep security high asides the usuals I create a new folder and a new set of scripts per each required demo with a folder extension created by a rand function. So first the folder is created and a set of tpl are copied in the new folder and written on. To make a story short: While testing on the production server I found some bugs and fixed them but the first trial attempt created a folder with a set of files that weight exactly as the tpl copied from and do have a correct PHP extension but refuses to be deleted or renamed or schmod etc... via FTP Now that I am bugless I can indeed do whatever with then newly created folders and files but still cannot delete my first test. When I try to del it it goes away but if I refresh it’s back there!
Folder/File Perms...
I made a PHP script that creates a new folder (say "Folder 1") and then copies a file from the parent folder (call the file "index.php") into the new folder; so we get Folder 1/index.php Now, how can I set the ownership of this file and folder, automatically via the PHP script, to me (the server user), not httpd?
Restrict PHP Usage From A Folder
Here's the context: We have a server and have been hosting our own websites for a while. But now, a customer wants to have FTP access in order to manage his static, non-PHP website. I found a solution that seems to work and would like to know if it is safe enough to be used. I added: <Location /> ForceType text/html </Location> To hpptd.conf file in the vhost entry of my customer's website. It seems to work fine, as all .php files are not parsed by php anymore. It is not easy nor possible to change the global configs of the httpd.conf and not possible also to install a separate apache server. So, do you believe that this is an appropriate solution?
Paging Of Folder Files
i have a form which has a select button when user clicks it a popup opens which shows all images in abc folder when user clicks on any image the window closes and the name of that image is entered in the text box in parent form, now its working fine uptill here but if user refresh the popup window then it disconnects from parent window so my code that fills the textbox in the parent form and closes the popup window does not work anymore im using it like parent.document.form.texthox.value=abc since popup window is refreshed it does not work as child any more and this code does not work.
Files And Folder Copying
I am trying to write a function to copy an existing folder and folder structure but am already stuck. What I want to do is the following: Copy a default folder (default_folder) and all sub folders within it (down to a possible 4 levels) eg default folder ->subfolder1 ->subfolder2 ->sub subfolder1 ->sub sub folder 2 I have a form where the user can enter the name of the new folder and an option to confirm if they want to copy the files also located within the default folder. If the checkbox is not checked then copy just the folder structure only Can this be acheived in one function or will it be based on 2 where a set of empty folders are created and where the folders and files are copied over
PHP 4.3.8 On WinXP - No Sapi Folder??
I am so confused right now. I installed 4.3.8 on my computer and am reading the install notes for apache. It refers to all these dlls and the sapi, but under c:php, I don't see any of that stuff! What is going on here?
What Is The Max PDF Files Allowed In A Folder?
Not sure where to put this question? I am building a book archives database with a front-end for some librarians. They want to upload book cover images onto the server (probably Win-NT). There are approximately 80000 records that will have the book cover images stored in a PDF document for each. Can I upload every PDF to the same folder? Is there some kind of limit for a folder?
|