NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Need some help with a PHP script...

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 12-20-2006, 05:02 PM THREAD STARTER               #1 (permalink)
^_^
 
Joey's Avatar
Join Date: May 2005
Location: Maryland
Posts: 976
Joey is a name known to allJoey is a name known to allJoey is a name known to allJoey is a name known to allJoey is a name known to allJoey is a name known to allJoey is a name known to allJoey is a name known to all
 



Help! Need some help with a PHP script...


Hi guys,

I've got a PHP script, it is a directory index. It shows all of the files in the directory, allows me to download, and even allows me to upload files. It's got everything I need, except for the ability to delete files. I would be very appreciative if anyone could add delete functionality to this script.

File is attached.

Thanks,
Joey
Joey is offline  
Old 12-20-2006, 05:31 PM   #2 (permalink)
Senior Member
 
Crusader's Avatar
Join Date: Aug 2003
Location: Canada
Posts: 1,257
Crusader is just really niceCrusader is just really niceCrusader is just really niceCrusader is just really nice
 



I can't look at it right now but if anyone wants to try, I think a simple unlink function will do the trick.
Crusader is offline  
Old 12-20-2006, 11:39 PM   #3 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
if this is still unresolved when I get back from work this evening I will gladly sort it out for you.
Peter is offline  
Old 12-21-2006, 05:10 AM   #4 (permalink)
Senior Member
 
champ_rock's Avatar
Join Date: Oct 2006
Location: http://akshayjain.org
Posts: 2,830
champ_rock has a reputation beyond reputechamp_rock has a reputation beyond reputechamp_rock has a reputation beyond reputechamp_rock has a reputation beyond reputechamp_rock has a reputation beyond reputechamp_rock has a reputation beyond reputechamp_rock has a reputation beyond reputechamp_rock has a reputation beyond reputechamp_rock has a reputation beyond reputechamp_rock has a reputation beyond reputechamp_rock has a reputation beyond repute
 



please post the new script also when u r done so that people like me may also benefit from this great script

p.s.: does it support remote upload function?
champ_rock is offline  
Old 12-21-2006, 02:08 PM   #5 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Attached as promised. It works and I have ensured people cant bugger about with the file name.

It doesn't look great where the delete link is but it works.
Attached Files
File Type: zip Script.zip (20.0 KB, 6 views)
Peter is offline  
Old 12-21-2006, 02:36 PM   #6 (permalink)
NamePros Regular
 
baxter's Avatar
Join Date: Apr 2006
Posts: 363
baxter is just really nicebaxter is just really nicebaxter is just really nicebaxter is just really nice
 


Ethan Allen Fund Save The Children
Thanks Filth I had a bit of a problem deleting files ouside of the root dir, And the regular expression died on the period. I changed the code and seems to work fine.

PHP Code:
if ($_REQUEST['delete'])
{
    
$to_delete './'.$leadon.$_REQUEST['delete'];
    if (
is_file$to_delete ) AND preg_match('/^[-_0-9a-z]+\.[-_0-9a-z]+$/i',$_REQUEST['delete'])===1)
    {
        
unlink($to_delete);
????: NamePros.com http://www.namepros.com/programming/271468-need-some-help-with-php-script.html
    }

__________________
Canadian Domain Registrar Ready.ca
baxter is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:34 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger