[PHP] Re: Directory permissions question

2010-04-20 Thread Nathan Rixham
Al wrote: > I'm working on a hosted website that was hacked and found something I > don't fully understand. Thought someone here may know the answer. > > The site has 4 php malicious files in directories owned by "system" [php > created dirs on the site are named "nobody"] and permissions 755. >

Re: [PHP] Re: Directory Listing

2009-08-26 Thread hack988 hack988
use realpath is better that i think 2009/8/26 Steve : > Ashley Sheridan wrote: >> >> On Wed, 2009-08-26 at 09:50 +0100, Tom Chubb wrote: >> >>> >>> 2009/8/26 Ashley Sheridan : >>> On Tue, 2009-08-25 at 17:08 +0100, Tom Chubb wrote: > > I've been playing about more and now I

Re: [PHP] Re: Directory Listing

2009-08-26 Thread Steve
Ashley Sheridan wrote: On Wed, 2009-08-26 at 09:50 +0100, Tom Chubb wrote: 2009/8/26 Ashley Sheridan : On Tue, 2009-08-25 at 17:08 +0100, Tom Chubb wrote: I've been playing about more and now I have the following code: $folder ){ echo "\n"; //Don't need folders as they're s

Re: [PHP] Re: Directory Listing

2009-08-26 Thread hack988 hack988
some code copy from my old codes for truncatedir function,it for backend compatibility. see this PHP_EOL (string) Available since PHP 4.3.10 and PHP 5.0.2 http://cn.php.net/manual/en/reserved.constants.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.ne

Re: [PHP] Re: Directory Listing

2009-08-26 Thread Eddie Drapkin
On Wed, Aug 26, 2009 at 9:45 AM, hack988 hack988 wrote: > I'm write a php file for you > = > define('Line_End', (PHP_OS == 'WINNT')?"\r\n":"\n"); > clearstatcache(); > > $mylist=array(); > listdir("F:\\Programming\\Web\\php",$mylist); > function listdir($dir,

Re: [PHP] Re: Directory Listing

2009-08-26 Thread hack988 hack988
I'm write a php file for you = define('Line_End', (PHP_OS == 'WINNT')?"\r\n":"\n"); clearstatcache(); $mylist=array(); listdir("F:\\Programming\\Web\\php",$mylist); function listdir($dir,&$list){ if ($handle = opendir( $dir )){ while ( false !== ( $item

Re: [PHP] Re: Directory Listing

2009-08-26 Thread Tom Chubb
2009/8/26 hack988 hack988 : > your means "Health and Safety Questionnaire"is directory? > so you want it display like this > full dir path <> filename<>date > Yes. I did try using if(is_dir($file)) { insert tab } but couldn't get it to work. Also tried counting the length of the $file value and an

Re: [PHP] Re: Directory Listing

2009-08-26 Thread hack988 hack988
your means "Health and Safety Questionnaire"is directory? so you want it display like this full dir path <> filename<>date -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Directory Listing

2009-08-26 Thread Tom Chubb
2009/8/26 Ashley Sheridan : > On Wed, 2009-08-26 at 18:21 +0800, hack988 hack988 wrote: >> "have a tab inserted in the middle of the path" ??? What it mean,I >> can't find any diffrent between last one with other rows. >> > It might be because of the way that the mailing list software converts > th

Re: [PHP] Re: Directory Listing

2009-08-26 Thread Tom Chubb
2009/8/26 hack988 hack988 : > "have a tab inserted in the middle of the path" ??? What it mean,I > can't find any diffrent between last one with other rows. > To clarify - this is what I was getting: /<<>>9216_100_REV_V1.0_bound.dwg<<>>05/08/2009 /Tender Docs/<<>>BAA Works Terms v1.1 (22.05.08).p

Re: [PHP] Re: Directory Listing

2009-08-26 Thread Ashley Sheridan
On Wed, 2009-08-26 at 18:21 +0800, hack988 hack988 wrote: > "have a tab inserted in the middle of the path" ??? What it mean,I > can't find any diffrent between last one with other rows. > It might be because of the way that the mailing list software converts the content? I tend to always make CS

Re: [PHP] Re: Directory Listing

2009-08-26 Thread hack988 hack988
"have a tab inserted in the middle of the path" ??? What it mean,I can't find any diffrent between last one with other rows. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Directory Listing

2009-08-26 Thread Tom Chubb
2009/8/26 Ashley Sheridan : > On Wed, 2009-08-26 at 09:50 +0100, Tom Chubb wrote: >> 2009/8/26 Ashley Sheridan : >> > On Tue, 2009-08-25 at 17:08 +0100, Tom Chubb wrote: >> >> I've been playing about more and now I have the following code: >> >> >> >> > >> error_reporting(E_ALL); >> >> ini_set('dis

Re: [PHP] Re: Directory Listing

2009-08-26 Thread Ashley Sheridan
On Wed, 2009-08-26 at 09:50 +0100, Tom Chubb wrote: > 2009/8/26 Ashley Sheridan : > > On Tue, 2009-08-25 at 17:08 +0100, Tom Chubb wrote: > >> I've been playing about more and now I have the following code: > >> > >> >> error_reporting(E_ALL); > >> ini_set('display_errors', true); > >> > >> functi

Re: [PHP] Re: Directory Listing

2009-08-26 Thread Tom Chubb
2009/8/26 Ashley Sheridan : > On Tue, 2009-08-25 at 17:08 +0100, Tom Chubb wrote: >> I've been playing about more and now I have the following code: >> >> > error_reporting(E_ALL); >> ini_set('display_errors', true); >> >> function getDirectory($path = '.', $ignore = '') { >>     $dirTree = array (

Re: [PHP] Re: Directory Listing

2009-08-26 Thread Ashley Sheridan
On Tue, 2009-08-25 at 17:08 +0100, Tom Chubb wrote: > I've been playing about more and now I have the following code: > > error_reporting(E_ALL); > ini_set('display_errors', true); > > function getDirectory($path = '.', $ignore = '') { > $dirTree = array (); > $dirTreeTemp = array (); >

Re: [PHP] Re: Directory Listing

2009-08-25 Thread Tom Chubb
I've been playing about more and now I have the following code: $folder ){ echo "\n"; //Don't need folders as they're shown with the files foreach( $folder as $file){ echo str_replace("./", "", $key) . "\t" . $file . "\t\n"; //Pad out with a tab for easy import into excel } } pri

Re: [PHP] Re: Directory Listing

2009-08-25 Thread Tom Chubb
2009/8/25 Ralph Deffke : > I would say > foreach( $dirTree as $key => $value ){ >    echo $key .""; >    foreach( $value as $v){ >        echo $v ."; >    } > } > > something like that > > ralph_def...@yahoo.de > "Tom Chubb" wrote in message > news:4577934f0908250241i195dc691x3f8c552e72791...@mail

Re: [PHP] Re: Directory Listing

2009-08-25 Thread Tom Chubb
2009/8/25 Ashley Sheridan : > On Tue, 2009-08-25 at 12:06 +0200, Ralph Deffke wrote: >> I would say >> foreach( $dirTree as $key => $value ){ >>     echo $key .""; >>     foreach( $value as $v){ >>         echo $v ."; >>     } >> } >> >> something like that >> >> ralph_def...@yahoo.de >> "Tom Chubb

Re: [PHP] Re: Directory Listing

2009-08-25 Thread Ashley Sheridan
On Tue, 2009-08-25 at 12:06 +0200, Ralph Deffke wrote: > I would say > foreach( $dirTree as $key => $value ){ > echo $key .""; > foreach( $value as $v){ > echo $v ."; > } > } > > something like that > > ralph_def...@yahoo.de > "Tom Chubb" wrote in message > news:4577934f09082

[PHP] Re: Directory Listing

2009-08-25 Thread Ralph Deffke
I would say foreach( $dirTree as $key => $value ){ echo $key .""; foreach( $value as $v){ echo $v ."; } } something like that ralph_def...@yahoo.de "Tom Chubb" wrote in message news:4577934f0908250241i195dc691x3f8c552e72791...@mail.gmail.com... Hi gang, I'm trying to create a

[PHP] Re: Directory Browse Concept

2004-02-02 Thread Paul Furman
Well, I'm installing post-nuke to see what that can do. I'm not sure I like the blog look that most sites have but I guess it has a lot of options. Probably more practical to just learn enough php to hack existing code to suit my needs. I had hoped to build something simpler myself which doesn'

[PHP] Re: directory size?

2003-04-03 Thread Philip Hallstrom
If you are on unix take a look at the "du" command. On Thu, 3 Apr 2003, Mantas Kriauciunas wrote: > Hey > I looked up in the manual but found only > Disk_total_space > Disk_free_space > > Is there anything like total_space for directory? > Or I will have to think of something else? > Like countin

[PHP] Re: Directory

2002-04-16 Thread Joel Colombo
http://www.php.net/manual/en/ref.filesystem.php all the file system functions Joel Colombo "Jeroen Timmers" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > > can i read a directory for files and other directory's with a php function > > for exameple

Re: [PHP] Re: Directory check

2002-04-08 Thread Hiroshi Ayukawa
Thamks, evwryone. I've never used is_dir. It was a great help. Hiroshi Ayukawa http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Directory check

2002-04-08 Thread Maxim Maletsky
try: if(is_dir($dir)) { echo 'directory was found'; } Yoroshiku, Maxim Maletsky PHPBeginner.com Hiroshi Ayukawa writes: > Does anyone know how to check a directory exiasts? > > Thanks in advance, > Hiroshi Ayukawa > http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=to

[PHP] Re: Directory check

2002-04-08 Thread Michael Virnstein
file_exists will perform a check if the file, no matter if it's a directory, a regular file or a symlink. if you want to know if it is a directory use is_dir($file) or refer to the php manual"Hiroshi Ayukawa" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

[PHP] Re: Directory to array to select box...

2002-04-05 Thread Michael Virnstein
ok, i'll try to help, but first use "while (false !== ($file = readdir($dir))". ;) why do you need hidden fields on that page? to determine which file the user has selected? hmmm...ok, let's see: The user sees your form, selects the desired file and submits the form. Now the page processing the re

[PHP] Re: Directory to array to select box...

2002-04-05 Thread Jas
Ok I tried a different way to do it and this is the resulting code... I still need to be able to make some hidden fields so the contents of the item selected may be passed to another script which will stick the path of the file into a database table if anyone wants to give me a hand with that part

[PHP] Re: Directory to array to select box...

2002-04-05 Thread Michael Virnstein
how about that: $file\n"; } ?> in your example there are two mistakes: 1. "while ($file = readdir($dir))" is wrong and should be "while (false !== ($file = readdir($dir))". (see php manual readdir) 2. "$file_count .="$file";" is not inside the loop, so you will only get the

[PHP] Re: Directory

2002-03-05 Thread Andy
Hi Roman, Check out: http://www.php.net/manual/en/function.mkdir.php Good luck, andy "Roman Duriancik" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED].; > Help me, I want create directory on local disc in php script, do you know > how ? > -- PHP General Mailing List (http

[PHP] Re: directory structure list

2002-01-24 Thread Mike Frazer
Write the whole thing as a function, and then do a check like if (is_dir("/path/to/directory")) { listDirs("/path/to/directory"); } PHP will allow you to recursively call a function from with that same function. Mike Frazer <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMA

[PHP] Re: Directory Listing and File Reading errors

2001-09-05 Thread Richard Lynch
> I'm recursivley reading and editing every .htm and .html file in a 500 page > website and upgrading it to contain linked CSS, Javascript includes and PHP > includes. i can't use a pre_pend file as there's more than one website on > the server, and the changes are embedded in the document rather

[PHP] RE: Directory Listing with PHP

2001-02-01 Thread Tim Ward
don't know what apache does but this will give you everything below the pathn you pass in. function sitemap($ddPath) { $dhandle = opendir($ddPath); echo(""); while ($ddFile = readdir($dhandle)) { if ($ddFile == "." or $ddFile == "..") continue; // trap . and ..