Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Re: Allow User to Select Which Files to Delete

by fuzzysteve (Beadle)
on Nov 19, 2001 at 16:51 UTC ( [id://126248]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Allow User to Select Which Files to Delete
in thread Allow User to Select Which Files to Delete

well, glob olny returns the full path if you are doing a search with the full path. if you olny search for *.*, it will show you the current directory. Not useful until you use
chdir("/Library/WebServer/Documents/userpages/$drt/");
to put you in the right place. Then you can use
glob("*.*");
to get the files. remember to do this both in the deletion and the selection bit

Alternitivly, get the length of /Library/WebServer/Documents/userpages/$drt/ and in the display section chop it off the front of the string

foreach (@files) { my $choppedstring=$_; substr($choppedstring,0,$length_of_dir)=""; print "<br> Delete this File: $choppedstring <INPUT TYPE=\"checkbox\" +NAME=\"files\" VALUE=\"$_\">\n"; }
Usernames aren't a great idea to pass around (if people don't know what a vaild user name is, then thats another step they need to take in breaking your security), although I'm not sure what another solution is.
as for the regex's, I'm not sure. They've never been a strong point for me.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://126248]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 05:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found