Using the Unlink Function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
moiseszaragoza
Forum Commoner
Posts: 87
Joined: Sun Oct 03, 2004 4:04 pm
Location: Ft lauderdale
Contact:

Using the Unlink Function

Post by moiseszaragoza »

I'm trying to use a the unlink Function
I'm passing information actoss the url

http://mysite.com/Deletefile.php?file=t ... filepasth/

Then Im geting the information with the $_GET
But the unlink doso not work.

Code: Select all

<?php 
	$file=$_GET&#1111;'file'] ;
	$dir=$_GET&#1111;'dir'] ;  	
	unlink($file$dir) ;
	echo "the file : $file has been delete";
?>
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Are any errors being returned?

try putting this as the top of your page

Code: Select all

error_reporting(E_ALL);

edit--didnt spot that feyd :P
Last edited by John Cartwright on Sat Feb 19, 2005 1:28 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

$file$dir isn't a file-path.
User avatar
moiseszaragoza
Forum Commoner
Posts: 87
Joined: Sun Oct 03, 2004 4:04 pm
Location: Ft lauderdale
Contact:

THanks

Post by moiseszaragoza »

Thanks I got it working
Post Reply