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.





Delete Complete Folders With Unlink Or Rmdir


i have a directory with structure like

project
- images
- include
- classes
- deletefolder.php

i want to delete three folders from project directory which is my main site folder. the page that will take action also resides in project directory. i was using command like
PHP Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Rmdir() And Unlink()?
im making a free file/ftp manager, so it will need to be able to delete files/folders, so, how do i delete files/folders that are inside a folder?

View Replies !
Unlink() And Rmdir() Permission
I use unlink() and rmdir() do delete files and folders, and I can actually do it only with files and folders created through the PHP script. If I try to do it with the files or folders creted manually, through the Explorer, I get the "permission denied error"!.
By the way, I know that I cannot delete non-empty directory. I still cannot delete the empty ones too?

View Replies !
Mkdir, Rmdir, Unlink Problems
i made a script that when some user register in a site it creates a folder and chmod that folder to 777. after that he can access is control panel and he can upload files to that folder. the problem is when tries to delete an error appears:

SAFE MODE Restriction in effect. The script whose uid is 730 is not allowed to access ../users/user/file owned by uid 48

View Replies !
Trying To Delete A File Using Unlink
i am trying to delete a file using the unlink function but it just is not working. i just get the Could not delete message. Is there anyway to find out exactly what is wrong? I've tried the exact path which is C:/domain/wwwroot/temp/0000000.txt but it just does not delete. Also i dont think it can be related to permissions because the 0000000.txt was created automatically by a script. The code i used is as follows:

<?
$delete = unlink("C:/domain/wwwroot/temp/0000000.txt");

if($delete)
{
echo "Succesfully Deleted";
}
else
{
echo "Could not Delete";
}
?>

View Replies !
PHP Unlink() & Mysql Delete
Im trying to delete a file, then delete the row in my table that holds the info for this file. I tried the code below and got this error:

Parse error: parse error, unexpected T_STRING in /nfs/cust/4/97/13/731794/web/Admin/backup/PXS_DeleteBackup.php on line 34


Here is my code:

View Replies !
File Delete / Unlink
i have made scirpt that list all the files in a dir so you can delete them but it wont delete i get the page as normal but when you select one and click delete it don't work! Code:

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 !
Unlink Command In Order To Delete The Images
I am developing a website that requires to upload, update and delete images. I have successfully managed to upload and update the required pictures but i have some problems when i try to delete the images. Actually i am using the unlink command in order to delete the images but the image is not deleted form the server. Because my client needs to upload images frequently, we cannot afford keeping the old images on the server. How i can actually delete the images and remove them from the server?

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 !
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 !
Permission Denied Error When Trying To Delete Folders On Windows
I'm trying to delete a folder from my php script using rmdir, but I keep getting permission denied errors. Creating folders and creating and deleting files within them works perfectly OK, but I can't delete the folders.

I'm using Apache on WinXP and have tried using various solutions I've found in various messages, but nothing works. I've tried setting partial and Full Control permissions for the Apache user, the Apache group, the IUSR_(machine name), everyone and even turned on the web sharing write permissions at every level from the folder itself right up to the top level on the partition.

All the files in the folder have been deleted before the rmdir, so I don't think that's the problem. PHP Code:

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 !
Deleting Files Using Unlink [function.unlink]: Permission Denied
I have a record in the db and a picture file name recorded with that record. I am writing a deletion routine which checks that file name and is supposed to delete it using unlink.

Although it reports the correct directory and file name, I received the following:

Warning: unlink(/home/pab/html/pics/test.jpg) [function.unlink]: Permission denied

I checked my permissions and the file is set at my user name and 666.

Does anyone know why this won't work or maybe another way to delete the file?

View Replies !
Warning: Unlink() [function.unlink]: Permission Denied In C:Program
i'm getting this error when i try to upload an image-
Warning: unlink() [function.unlink]: Permission denied in C:Program Filesxampphtdocsepeopleupim.php on line 79

Does this mean i need to change the directory permission to allow php to move/copy an image into the directory?  if so, can i right-click on directory folder (i use windows xp) and go into properties and change the permissions in there? If so, what do i change it to? Code:

View Replies !
Warning: Unlink() [function.unlink]:
i tried to use the unlink function to delete an image but i get an error message whenever i try to do it.

Warning: unlink() [function.unlink]: http does not allow unlinking in /home/ppages/public_html/doc/admincontrol/models/forhire/edit.php on line 15

anyone have any ideas?

View Replies !
Rmdir Not Working
I'm trying to delete folders on my website that were created using a script. The code being used to create the folders is simply:

mkdir($new_folder, 0755);

The code I'm using to delete the folder is:
$rmdir = "rm -rf $path";
`$rmdir`;
if($rmdir) {
echo $path." deleted<BR>";
} else {
echo $path." not deleted<BR>";
}

Also, rmdir($path) doesn't work. Can I modify the script so that the folder gets deleted or do I need to make some changes to php.ini or other server file?

View Replies !
Problem In Rmdir()
I have a problem in rmdir() function its doesnt work and i dont know why. this my code PHP Code:

$folder="foldername";
    $dir=opendir($folder);
    while (false !== ($file=readdir($dir))) {
        unlink($folder.'/'.$file);
    }
    @rmdir($folder) or die("the Folder isnt delete");

View Replies !
Rmdir() Problem
i upload files into directories created and save the record in text file List.txt, then i read the record from the file and delete the files inside and then remove the directory, my code: Code:

$fpDel=file("List.txt"); //read out the record in the List.txt
for($x=0; $x<count($fpDel); $x++) //get the path and file name of every file uploaded and remove it
{
$fileExplode=explode(" ", $fpDel[$x]);
$fileNameDel=$fileExplode[0];
$filePathDel=$fileExplode[3];
unlink($filePathDel."/".$fileNameDel);
}
for($t=5; $t<count($_SESSION['defaultFolder']); $t++) //remove the new folder created
rmdir($_SESSION['defaultFolder'][$t]."/");

View Replies !
Rmdir And Chmod Help For Windows XP Home!
From what I read from the PHP manual, chmod on a Windows platform
should have no effect, and that seems totally normal (unless someone on
sourceforge has a windows port of that!).

I create a directory on my Windows box, and set chmod 777 on it (that
should be full access for everyone if my memory serves me correctly),
but when I want to rmdir that directory, I get a permission denied
message (I can delete contents from that directory with no problems, and
I can create/delete subdirectories either by hand or by script with no
problems.

I tried creating a subdirectory with the same name and without the chmod
in a test script and everything went OK...

I then commented out the chmod line in my script, and now, directory
creation and delete works fine!

So, for PHP on windows (xp home?), chmod 777 makes the file undeletable
for another PHP script, but not for Windows explorer or the windows/dos
command line....

View Replies !
Directory Problems, Eg Mkdir, Rmdir And Rename
my current dir system is as such: root /admin/product

i have a script in admin directory. it manged to create a directory called bottles with this php function call PHP Code:

View Replies !
Delete Record - When The Delete Link Is Clicked The Next Page Is Blank And Nothing Is Deleted.
This is my "delete.php" and this "todo/delete.php?id=64" an example of a link to it generated from the index.php page. When the delete link is clicked the next page is blank and nothing is deleted. What have I done wrong?

<?
include("dbinfo.inc.php");

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$id="delete from todo where id='$id'";
mysql_query($id);

mysql_close();
?>

View Replies !
Mysql Delete - $query = Mysql_query("DELETE
how would i do the following ?

$query = mysql_query("DELETE notes, datestamp, abs_value, ID FROM absence_mgt  WHERE datestamp='$date' AND ID='$vtc_login' ") or die(mysql_error());
im just getting "Unknown table 'notes' in MULTI DELETE" ?

View Replies !
Run Complete It Before Go To Next
i had a pages that save as .php file type. in site the pages i had write by javascript and php programming language. i would like to run the javascript programming 1st and show out the result before the php start execute. is poosivble to done that? this my coding:

<script type = "text/javascript">
var processingStatus = window.open("processingStatus.html","processingStatus","fullscreen = 0,width = 250, height = 250, resizable = 0, menubar = 0, scrollbars = 1, status = 0, toolbar = 0, top = 280, left= 300");
</script>
<?
//some coding here,,,,,
?>

isnt possible to show out the prompr out window with result and jz run the php coding?

View Replies !
Auto-Complete
I'm just curious why Dreamweaver and most Text / HTML editors default to "auto-complete", where you hit a "<" and the other half is provided for you.

For me, all that means is I have to reach out away from the home keys to hit the "end" key or the right-arrow to get to the end of the line before hitting enter. I'd rather hit the ">", it's closer and quicker.

Does anyone find that "auto-complete" handy.

View Replies !
Complete Brain
I am doing the following: PHP Code:

preg_match_all("/<p>(.*?)</p>/is", $results[1], $city_results);

this is returning about 30 instances of anything between <p></p>. I want to loop through the array that I am capturing only display the first 4 or 5 <p></p>. PHP Code:

for ($i = 0; $i < 4; $i++){

THIS IS WHERE I AM HAVING THE BRAIN FFFFFFF

}

View Replies !
Complete To Full Url
I have a links extractor in PHP, but some links extracted are only relative e.g: test.htm
and other full,

I would like to let all links full. is there any php function to do that? I am testing for a while with no satisfied results.

View Replies !
Complete Noob
I'm using a mysql select from statement which can be seen below PHP Code:

mysql_query("SELECT * FROM massive WHERE hello = '$hello')

Now my table called massive is very big so I learned that I need to use an index. So how do I use indexes? I've looked them up but I still can't seem to figure out how they work and how I implement one.

View Replies !
Complete Newbie To Php
I am still trying to set up my system i am learning from a book, Sams Teach yourself PHP. The problem I am having is viewing my code online. I have downloaded the PHP program from php.net. I write the code in notepad but when I try to open the code in IE it prompts me to a scree saying I need a program to view the information.

View Replies !
Complete/not Corrupt
I'm working on a site which receives jpeg still images via FTP from a webcam. I have a script which each day copies a certain image (the one sent between 3pm and 4pm) to the "live" site. Is there any way to check the source image file before copying to ensure it is complete i.e. it wasn't only partially transferrered, or isn't corrupt.

View Replies !
Not Getting The Complete String
ON PAGE 1 I HAVE A LIST BOX AND I CHOOSE "ONE TWO" FROM THE LISTBOX. Code:

View Replies !
Unlink ( .. )
I need to delete my .jpg files from folder and i'm using: " unlink('files/'.$foto); " as i understand unlink() removes only link but not delete my file ?!

so i need to delete my pictures.jpg files from folder.

View Replies !
Unlink In IIS
I know there are many posts about unlink() not working but ive tried everything and I cant get it to work. This is my command:

$dir has the directory location
$item is the name of the file

unlink($dir.$item);

I can create directories and files fine, but when I come to delete them it wont do it. Unlink always returns false. Im using IIS 6 w/ PHP5 on Windows Server 2003. So I tried the system( del " " ) command and that didnt work either. Im kinda new to IIS so im not sure how to check/set the permissions for the PHP script to delete a file, but do I even need to since I was able to create directories/files already?

View Replies !
Unlink
I am doing a CMS for a client web site but cannot make the unlink work on a windows based server. I have no problem uploading a new file on the server. But when I try to upload a new version of that file with the same name, the move_uploaded_file does not overrite the existing file. I added a check to see if there is a file and delete it but still no luck.

if (is_uploaded_file($HTTP_POST_FILES['fileupload']['tmp_name'])) {
if (is_file($path.$SOQname)) unlink($path.$SOQname);
if (move_uploaded_file($HTTP_POST_FILES['fileupload']['tmp_name'], $path.$SOQname)) {
$message = '<strong>New SOQ uploaded.</strong><br>'
} else {
$message = '<strong>uploaded but not moved to the correct folder.</strong><br>'
};
} else {
$message = '<strong>not uploaded.</strong><br>'
};

View Replies !
Complete Admin Module (OOP)
here is the complete finished code: there are 3 main files: admin_shared.php
( this calls the database class and then calls the admin class) PHP Code:

View Replies !
Auto Complete From Database
Does anyone know of a script or know of a way to create a form, like you see when you search on Yahoo or Google that will predict your search result as you type and show the values listed below the form? It is sort of like the "auto complete" but it's showing results that you haven't necessarily typed in. I'm looking to create a form like this that will show names from a database as you type.

View Replies !
Use One Form Field To Complete Another
My problem is this: I have one form field from which counties are selected, and I want this to fill a field below it with the towns in that county. This represents my dismal attempt at achieving this: Code:

View Replies !
Searching For Complete Words
I have a field containing keywords. Some rows content for this field are something like "dog cat animal horse farm countryside".

At this point I am looking for a MySQL query to get those rows that exactly contain this keyword-field "animal" If he serches for "anim" no results will be given.

In other words: "select rows where table.keywords contain '$k' as a part of words separated by spaces" ($k= anim ->no results) ($k= animal ->some results).

View Replies !
Auto Complete Textbox
I want an Auto-complete text box Where the values are coming from the database. Just as like G-mail's  "Mail to" text box.

View Replies !
Complete Loss Of Memory
I cant for the life of me remember how to do it. and i don't know what you call it, so i cant even go to my old friend google. Anyway, its something like this PHP Code:

IF ($condition) TRUE ? FALSE

I'm getting syntax errors when i try it. Such a retarded thing to forget.

View Replies !
Complete NOOB Here..Passwords $
I have installed everything, installed the database files (i verified they were there) and when i go to index.php, the username and password do not work.

This is not the first time this has happened to me, i have other php stuff that i can never seem to get logged in to... i thought it might be server related, so i started a site with 1and1, ..

If someone could please help me get this up, i would be willing to pay for some help (i dont have much, but this shouldnt be a hard issue to fix... i also have lots of hosting space and bandwidth)

i changed the name of index to homepage.php so you can go here and get whatever files you might need to look at.

View Replies !
Downloading Complete File
i have a php script that creates a file which always writes 100% of the data to this file. this part works fine. the next part of this script is letting the user download that file. when i run it on my localhost, everything is fine and 100% of the file is there. however, when i run it on a different server, for some reason when you download the file, it always gets cut off at 2000000 bytes. so the file that gets downloaded can be much smaller than the original file. is there something i need to change in the php.ini file or any other suggestions? this is my download. php code:

$file=$path.$_GET['file'];
header("Content-type: application/force-download");
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($file));
header("Content-disposition: attachment; filename ="".basename($file).""");
readfile("$file");

View Replies !
Auto-complete City &
Tricks for doing cute things with PHP:

* HTTP Client
* Detect IP Address
* Detect Proxy
* XML Tag Parsing
* Geographic IP Lookup
* Auto-complete City & Country

View Replies !
Complete Registration System
i am as new to php as one can be, but someone told me to check this place out so here i am. i need help creating a complete registration system with the following requirements: Code:

View Replies !
Passing Complete Classes
Obviously there are many ways to pass parameters between pages, but what I want to achieve is the ability to pass an entire Class and all it's contents from page to page. I think it may involve the use of the serialize function, but am unsure if this is the correct way to go about .

View Replies !
Auto Complete Hint
I type the first charecter again, I get a list of auto complete hints to save me the trouble. This stopped working sometime ago and I could not find out how as I checked the latest code. I have discovered that it is IE7. Under FF Opera Netscape and Safari it works fine. Is this an option in IE7 I went to great lengths to create a session variable name on a new instance of the browser, so that it only showed me todays history.

View Replies !
Complete Obliteration Of Errors
My boyfriend works for a company where its impossible to get any error messages in PHP on their servers. And we have no idea why. He's tried setting the error reporting in the script and in a .htaccess no errors at all.

View Replies !
Unlink Permissions
I was just wondering how to assign the appropreate permissions so files can be removed using unlink in MS Vista. I have set the folder to allow full access to all users but this does not seem to be enough.

View Replies !
Unlink Function
i have a problem with unlink function. if i'm trying to use uplink like this:

unlink("../home/meks_party.jpg"); i got the message:
Warning: unlink(../home/meks_party.jpg): No such file or directory in /home/alphadyn/public_html/wakeboarding/manage/doAction.php on line 24

where could be the problem?

View Replies !
Unlink To Recycle Bin
can bi done? instead of ordinary file-is-gone-for-good unlink(), file should have been only moved to recycle bin? i know k can make my own recycle bin and store my files there. what about ordinary windows.

View Replies !
Unlink Permission
I know I setup the permissions right and I gave everything write permissions. Still to no avail. Check out this error:

Warning: unlink(pfwdata.inc.php) [function.unlink]: Permission denied in D:www50marketing
emote_script.php on line 3

The [function.unlink] is a link to nowhere. What the crap does all that mean? Has anyone else had this problem? I am betting it's an IIS problem.

View Replies !
Unlink All .png Files
this is another problem I'm having with unlink. This is the error i get:

Warning: Invalid argument supplied for foreach() in d:ServerApachehtdocs rackerincludesdelete.php on line 17

On line 17 and onwards, i got just this: PHP Code:

foreach (glob("*.png") as $filename) {
unlink("$tempimgpath/$filename");
}

in config.php, which is included in delete.php by the way
$tempimgpath = "d:/Server/Apache/htdocs/tracker/images/temp";
and I've also tried with directory, like
$_tempimagedir = "images/temp";

but everytime I get that error, any idea what I'm doing wrong?

View Replies !

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