john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

phpnotes

chdir chroot dir closedir getcwd opendir readdir rewinddir scandir

http://uk2.php.net/manual/en/function.readdir.php

number one errors: forgot ; { } ( ) / or // or \ or \

Valid back-slashed characters \n linefeed (LF or 0x0A in ASCII) \r carriage return (CR or 0x0D in ASCII) \t horizontal tab (HT or 0x09 in ASCII) \ backslash \$ dollar sign \" double-quote [0-7]{1,3} the sequence of characters matching the regular expression is a character in octal notation \x[0-9A-Fa-f]{1,2} the sequence of characters matching the regular expression is a character in hexadecimal notation

autoincpk int(11) No auto_increment
ip int(11) No
when datetime No

$ilogin_sql_server = "localhost"; $ilogin_sql_username = "user_name"; $ilogin_sql_password = "password"; $ilogin_sql_database = "database_name";

'YYYY-MM-DD HH:MM:SS' foupfeiffer_dbuser 124578

foupfeiffer_webcounter

/ my index.php file 12oct07/

$d = dir( getcwd() ); echo "Handle: " . $d->handle . ", Path (not necessarily accurate): " . $d->path . "\n
"; echo "" . $d->path . "/";

$dh = opendir( getcwd() );

while (false !== ($file = readdir($dh))) { if( $file != "." && $file != ".." ) //don't test the root directories { if( is_file($file) ) { $filelist[] = $file; } else { $dirlist[] = $file; } } }

echo "\n" . getcwd() . " contains " . sizeof($filelist) . " files and " . sizeof($dirlist) . " directories\n
\n";

sort($filelist); sort($dirlist);

echo "

\n"; //a table for our dir/file names & sizes foreach ($dirlist as $value) { echo "";
echo ""; echo ""; echo ""; echo "\n"; } foreach ($filelist as $value) { echo "";
echo ""; echo ""; echo ""; echo "\n"; } echo "
" . $value . "" . filesize($value) . "" . date("dMy @ H:s T", filemtime($value)) . "
" . $value . "" . filesize($value) . "" . date("dMy @ H:s T", filemtime($value)) . "
";

closedir($dh); $d->close(); echo "\n";


  • « regular expression link href
  • website ecommerce tips »

Published

Feb 6, 2010

Category

php

~197 words

Tags

  • php 82
  • phpnotes 1