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.





Root Of Folder App Files


While I know putting a app into a folder was chiseled out of fine
scottish granite and carried upto the top of ben nevis by php newbies
many years ago - I dont think a folder is the best way to do it .

The fact a script is in a folder means certain instant problems if you
want to do certain things with .

Assuming a script doesnt have index.php and all the script files have a
filename prefix like phpgb_ then theres no chance of them clashing with
anything else and theres no real reason to continue using a folder for
the main script files .

While the script will have a app folder for various things - does it
make any sense not to use the root because of a single solitary file
called index.php .

phpgb_index.php is what I use and the method hasnt brought up a single
problem of any shape or description .

Gas lighting was once what everybody thought was the best way of doing
it until that darn new fangled electricity came along .




View Complete Forum Thread with Replies

Related Forum Messages:
I Can Upload Files Anywhere Except My Remote Root Folder
Im working on a project with PHP that allows users to upload pictures to my server and then reference them. After going through some uploading tutorials I have the uploading part working Except! I cant upload folders to my remote root folder. I need to allow the users to upload somewhere inside the root folder so they can reference the pictures in code after.

Just to clarify the uploading works perfectly if I put the uploads folder anywhere on my computer except the sites remote root folder (or anywhere inside the root folder)
I also beleive I am giving the folder all of the proper permissions because I am giving the uploads folder in my root directory (the one that doesnt work) the same permissions as the one outside the root (the one that works) Code:

View Replies !
Cron Job Creating Backup Files In Root Folder On Server
In root folder of my server, I see files like optimize.php.95(optimize.php is the file name we added for cron); files go from .1 and upward. Also happens for other files, seemingly related to the cron jobs we are running. When I open and download the files, there is no content in the files. Do you know what is causing these files to be created?

I think they are harmless, except that I think it prevents us from seeing backups generated in root folder, as ftp only allows so many files to be listed. For example, I created a recent backup, but cant seem to find it in the root folder using ftp (I think because these files are crowding out the backups from being listed).

Are these files unnecessary? How do we eliminate these files to be created.


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 !
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.

View Replies !
The Safety Of A Folder Below The Root?
I include a php file from a folder that's below the root directory of my website. This included file has some sensitive information and I was wonder how secure this file is?

Is it something I should be concerned about? Is there a way that someone can gain access to this file?

View Replies !
Determining FTP Root Folder From Path?
I have been working on a GUI web photo album for *nix. I had thought it might be workable for users to open a browser based FTP session to upload pics to a newly created album directory. The problem I am having is opening the FTP session in the new folder. I.E. we have just created
images/myAlbum1. Using realpath(.) we get /home/someUser/public_html/images/myAlbum1 . Unfortunately the browser based FTP wants the site root not the server root and the connection fails.

Is there a reliable way to determine site root from path?

I don't want to regex the path for /www and /public_html, seems like that would be rash...

View Replies !
Php.ini File - Cannot Find In My Root Folder
hey. i have a memberscript that i am having trouble with.

my users want to upload their own avatar, but it is not letting them. the file in which the avatars are sent to are chmodded correctly.

i think it may have to do something with the php.ini file, but i cannot find it anywhere in my root folder. i have godaddy hosting and i contacted them but they didnt help me at all.

View Replies !
Find And Replace Under The Root Folder
Suppose I want to add 1 single line:

<script src = "/sample.js" type="text/javascript"></script>

to every single webpage ( preferrably right after the tag <head>) under the root folder called public_html in my server, i.e including all the webpages in the subfolders as well. Suppose I have sample.js in public_html as well.

View Replies !
Installation Works Only In Base / Root Folder
I've installed PHP and Apache several times, but I havn't a clue what's going on this time. I installed the newest version of Apache 2.0 (not 2.2) and the newest PHP 5.

It's all working and such, but it only processes pages in the base folder. Like localhost/file.php will work, but localhost/folder/file.php will only come up with a blank screen.

View Replies !
Installation Problem Of Bb2 Forum On The Root Folder
I just decided to start a forum so decided to install phpbb2 forum software which is provided by my host. I am unable to install the forum on the root folder inspite of trying many times many different things . I have tried the following things :
1)When i tried to install for the 1st time i got the error something like public_html already created . Code:

View Replies !
Mod_rewrite - .htaccess File Place It In Root Folder
well this is my .htaccess file which is located in my website folder but when i want to place it in my root folder so the url can go right in my website folder it cannot do it because is telling me this. Code:

View Replies !
Drag Files From One Folder To Another Folder (copy) .. Possible?
Is it possible to write codings PHP or Javascript.. GUI representation
of File handling (ie. Drag files from one folder to another folder (copy)
like our windows).. pls give me some reference codings like this..

View Replies !
Access To Mp3 Files Below Web Root
I want to place some mp3 files below the web root directory to keep people from accessing these files. however i want certain php scripts to be able to use them (ie for a flash movie that plays mp3 files)whats the best way to accomplish this?

View Replies !
Accessing Files Outside Of The Web Root
Anyone got any pointers for a script and/or advice for accessing files that are outwith the root directory. I am using Apache on WIN2K Server (a box which is also running IIS on port 81).

I want user to be able to select a file and have a script verify their security clearance level (although I have this part worked out already) and then to supply a relative url from the web page they are on - out of the web root - to the file in question.

I have been toying with the 'realpath' function but to no avail thus far. I have tried using the path:

../../../files/{filename}
where the path to the web root (from the page in question) is
../../../

on my notebook (running WINXP Pro and same version Apache and PHP this works fine) but on the production server it cannot find the path outwith the server root.

View Replies !
PHP Files Only Run In Root Directory?
I've installed a php forum script under a directory named 'forum', the script ran with no problems untill about a week ago, but now I get the following error: 'You don't have permission to access /forum/index.php on this server.'

Its has nothing to do with CMOD, I've tried that. Worst still it's not just the forum it's any PHP file thats under a directory. The thing is, I can run a PHP file from the root directory, but for some reason can't run the same file under another directory.

eg www.mywebsite/testfile.php --- will work fine www.mywebsite/newdirectory/testfile.php --- causes permission error

Could it be a .htaccess problem? Heres my error log report: Options ExecCGI is off in this directory: /home/mywebsite/public_html/forum/index.php P.S The forum script dosn't use CGI?

View Replies !
Reading Files Below The Web Root
I have been tring to make a script that can read my "new mail" directory which is below the web root. I have a simple script that reads a directory and dumps the files in it ot the screen. It works fine for files inside the web tree, but i cannot read files below? Is there something i need to do to allow this? Is this a security issue?

View Replies !
Hiding Files Below Web Root Directory
I'd like to hide sensitive info in files below the webroot. Say sql access passwords in a .php file. I have tried using "/../[file name]" with no luck. Shouldn't "/" take me to the web root and "../" then take me one level lower? I am running on a Linux server if that makes any difference.

View Replies !
PHP Not Bringing Up My Files In My Root Dir, On Sever
when I type in the url to go to .php file it is supposed to show all of the files that I have in root folder, but it does not show any of the files, the hosting support said that there is nothin wrong at there end,

and the script that I wrote does not have errors in it, but for some reason it does not want to show the file.

View Replies !
Giving Access To Files Outside The Web Root
I was wondering if anyone could help me with making a link to a file outside a web root. For example, I have a huge video file that I recorded of surfing on my external hard drive that will not fit under my htdocs root folder.

As a result, how would I make a link to my J: drive (which is outside my web root) so people could download this video? Would I need a php script?

Also, because this file is big, I also want to make sure it doesn't create a temp folder while the file is transfering. One more thing, how would i protect against directory traversal?

View Replies !
Uploading Files Outside The Document Root
My Document Root is /var/www/html
I've created a directory /var/www/uploads

I cannot seem to get a script to upload to this uploads section.
I have 777 permissions to the folder (don't like that idea but....) and still.
I created a folder under the doc root and it works just fine.

How do I go about actually getting the file uploaded above the doc root?

Current Code

PHP Code:

View Replies !
.tmp Files Being Placed In The Root Directory By The 100's, Want It To Stop
Hi folks, I have a bit of a problem, perhaps one of you knows what is going on.

According to the sys admin at my ISP, something from my site (which is entirely php) is saving 100's of tiny files with the extension .tmp into the root directory on the server where my site is located.

He doesn't know very much about PHP and neither do I (this is the first site I've ever produced using it) so neither of us knows what could be causing it, there is one other site hosted on that server that is running PHP and it is doing the same thing, although the lion's share of temporary files are coming from my site.

I have a copy of the php.ini file that he emailed to me this morning, if it would help to post it please let me know and I will do so. We are not sure what is going on, but we would like to know if there is some way to make it stop (or at the very least, to get these files to destroy themselves once they're no longer usefull)

Also: I would like to thank SilkySmooth for his mail script, I used it awhile back and it got the job done. Thanks so much!

View Replies !
Executing System Files Deep In The Root Tree
I am running on an linux box with ensim webppliance. Ensim is really cool because it has a hold folder of files that perform different tasks that you would normally do from the interface. My problem is, i don't want to do them by hand, i want one of my PHP scripts to executre them and return the results. Now, there are a few problems, like you have to be root to run these scripts, cus they are in /usr/local/bin. I tried shell_exec, and exec, but I can't seem to figure out how to do this correctly.

View Replies !
How To Detect Number Of Files And Files' Name In A Folder?
I have a server built in window + apche. I am trying to make a photo album, but I don't know what is the code for detecting the number of files in a server folder and the files' name~.

View Replies !
Files In A Folder
I need a script that checks for the amount of files in a folder. Is taht possible with PHP.

View Replies !
Files In Each Folder
I'm looking for a script that will display how many files I have in 5 of my folders. for example.

Folder 1 ( 2 files )
Folder 2 ( 0 files )
Folder 3 ( 15 files )

View Replies !
How To Get The Files Names From The Folder Using PHP ..
How to get the files names from the folder using PHP .. is there any
specific command. If yes let me know that..

View Replies !
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.

View Replies !
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

View Replies !
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?

View Replies !
Deleting Files From A Folder...
I have a folder with many pictures in it.
All have the name like: HHMMDDMMYYYY.jpg

H-hour
M-minute
D-day
M-month
Y-year

Now I want to delete all pictures which are older than now()-7days.
How Can I do it? In SQL would be no prob but with file deleting is problem.

View Replies !
Opening Files In The Same Folder..
I have a php file (1.php) that needs to open another php file (2.php) and parse it's output. 2.php gets it's data from an xml file and formats it in a pretty screen style. So what I need is something like: $fp = fopen ("2.php?file=file.xml","r"); but that wont work because there is no file called &#392;.php?file=file.xml' so how's it done?

View Replies !
1 - 2 Millions Files In One Folder?
I have to store over a million files, 10 - 15 kb each, in one folder.
The files are created by my php script, sometimes the old files are
deleted and new ones are written.
So, basically on every connection my script reads/deletes/ writes files
from/to that folder.
Right now i have only around 300 000 files in that folder, and it feels
like its getting slower for that script to work. It does work at the
moment, but i am not sure what will happen when there is over a million
files there...
Are there any limits of files that can be stored in a folder?
Would it be better for me to use mysql? I am not sure how mysql will
cope with millions of writes/reads

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 !
Pagination W/ Just Files In A Folder?
Example would be:

prev 12345 next

but doing this with just files and not DB records?

View Replies !
Viewing Files In A Web Folder
I'm trying to put my files in a web dirctory.  All kind of files, so that in the future when I need something I just go there and get them.  My goal is that when I type "www.domain.com/myVitualDirectory" I would get my list of files and folders and files and I would even be able to navigate into the folders, then I would right click and Save Target As and get my file.

View Replies !
Php Include Files From A Folder
I want to make a folder filled with blog posts by date.  Each file will be like 20071113.php and 20071031.php basically the date they were written 2007, 10 for october, and 31 for the day.  But each will be notated like that so that the number is always increasing. 

How would I make a php include function as to take the last ten highest numbers and add it to a page? (Basically the last ten posts by date) and  How would I include more than one post per date?

View Replies !
Counting Files In A Folder
I want to count how many images are in a file.. all are .jpg some .JPG .. how can i do this??

View Replies !
Folder With Files From Server To Another
I am trying to transfer a folder with files from server to another.

I found a script online and it sort of works. What it does is copy files from the root folder (which it shouldn't) and puts into the folder I am trying to copy from.

What I need is it to copy from the $ftproot into the $srcroot/$srcela folder.....

View Replies !
How To Count The Files In Each Folder
I'm using this:

<?php
$dir_path = "/var/www/vhosts/website.co.uk/subdomains/demo/httpdocs/clients/$login"; 
$images = count(glob($dir_path . "*"));
?>
now, <?php
include "scripts/connection.php"; 
if (!$con) 
{ 
  die( 'Could not connect: ' . mysql_error() ); 
   }
mysql_select_db($db, $con); 

$result = mysql_query("SELECT * FROM album WHERE active = 'yes'");
?>
how can i get it to count the files in each folder, ie <?php 
$dir_path = "/var/www/vhosts/website.co.uk/subdomains/demo/httpdocs/clients/client1";
$dir_path = "/var/www/vhosts/website.co.uk/subdomains/demo/httpdocs/clients/client2";
$dir_path = "/var/www/vhosts/website.co.uk/subdomains/demo/httpdocs/clients/client3";
$dir_path = "/var/www/vhosts/website.co.uk/subdomains/demo/httpdocs/clients/client4";
$dir_path = "/var/www/vhosts/website.co.uk/subdomains/demo/httpdocs/clients/client5"; [/code

View Replies !
Copy Files From One Folder To Other Using PHP?
how can i dopy files from one folder to other using PHP? exactly i need to select some files on the server then after clicking submit those files should be copies to a local directory from the server.



View Replies !
What's Your Folder Structure For Your Files?
So, I'm looking to get started on my first application, and my first question is about folder structure on the server and what are the best practices?

When I create static content today, I create one folder per page usually to keep things organized. Any components are included in the related folder, and global components are added to a top level components folder.

I realize the dynamics of PHP will reduce the need for hundreds of pages, and that's why I'm excited to learn this language. However, I still need to keep even the dynamic PHP files and components organized.

I've seen some sites, where people put all their PHP files on the top level folder. Just wanted to get your feedback on how you guys keep your server folder structure organized?

View Replies !
File_get_contents From Files In A Folder
$dir = 'matchreports';
$dh = opendir($dir);
             while (($file = readdir($dh)) !== false){
        $fullfile = $dir . $file;
        $subtotal[] = file_get_contents($fullfile);
I am getting this msg "Warning: file_get_contents(matchreports010407.php) [function.file-get-contents]: failed to open stream: No such file or directory"

010407.php is one of the files i need to retrieve the contents from, including others from the folder.

View Replies !
View Folder Files
i am looking for a script (in php) which would list the contents of a certain folder on my server and be also able to delete selected files.

View Replies !
Security Of Files In A Folder
I'm creating a database for old tests that people have taken. The tests are scanned in and stored in a folder on my server. In order to see them and navigate the many pdf files, you have to login with a username and password. I know how to do all that, but how can I password protect. pdf files on my server so that they can only be accessed from the point after the user has logged in? Everything works dandy except for the fact that people can directly link to a. pdf file (a huge security risk). Also, if I don't password protect the directory of the pdf files, can webcrawlers find the information and store it in their search database?

View Replies !
Putting Files In A Folder
I have a script that makes PHP files. I would like to put them in a separate folder. I mean I want the script to be in a folder and the files it makes in another folder.

View Replies !
Download A Whole Folder Of Files
Is it possible to let a user download a folder with several files? For example a folder with many jpg files? I mean when the user presses a download button or link he will automaticly be downloading all files from the folder.

View Replies !
Number Of Files In A Folder
I want to use a loop to list the file names in a folder. How do I find out the total number of files in the folder so I know when to end the loop? I can't use 'file exists' because the file names could be anything.

View Replies !
Sort Files In A Folder
I've got a bit of a problem. I found a script that reads files from a folder, and I modified it so that it can read image files and give extra info about them. but it only sorts the files by alphabetical order; I want it to sort them by date as well. I've been tinkering with it, but all to no avail. I only got it to sort the files by reverse alphabetical order (rsort()). Here's the whole script:

<?php

$folder = 'http/path/to/folder/';
$imgdir = 'absolute/path/to/folder';
$allowed_types = array('png','jpg','jpeg','gif');
$total_images = count(glob("$imgdir{*.gif,*.jpg,*.png, *.jpeg}", GLOB_BRACE));

?>

View Replies !
Indexing Text Files In A Folder
I'm newbie on Php. I cannot write codes but only modify.
I need a code doing this:
I'll put text files in a folder like file1.txt,file2.txt ...
I want to search this files, list most recent 10 and if files

call, script will put into the site design with <pre> tags.

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 !
Recursive Copy Of Folder/files
I want to copy entire content(have both files and folders)from One folder to destination folder..

View Replies !
Opening All Text Files In A Folder
Im very new to php and need a bit of help. basically what I have is a folder with a number of text files inside. What i need to do is open every text file in that folder and then process the information inside each text file.

Im not really sure but I would assume I open the directory and place the name of each text file into an array and then loop through the array and process the contents of the text file.

#open directory

#foreach text file in the directory
#store file name into an array

#loop through array
#process code

View Replies !

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