Jump to content

jimbowvu80s

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by jimbowvu80s

  1. I'm trying to figure out how to format a variable. I am listing the contents of a directory from an array and I trying to format the date field to be like - Jan 07, 2011 01:35 PM. When I try this format I get a 500 error message. <td width="'.$width_of_dates_column.'">'.$files("M d Y h:i:s A", filemtime['date'])[$key].'</td></tr>'; Is is possible to format the date after it's been put into the array or does it have to be done while it's being processed. Not sure if you need more code to determine the formatting. Please let me know if you do. Thank you.
  2. Thanks Thorpe for the reply. When you suggested bad code I wanted to make sure there wasn't with the code and I noticed that there were short tags used in the script. I'm new to php and it took a while to figure it out.
  3. Are you refering to the PHP.ini file or the web.config file?
  4. Is it possbile to use PHP to list directories outside of the root of the web server - for example c:\images or d:\images? I can use this script to list the files from the root down, but when I change the path to look at something outside the web server directory I get zero results back. Thank you. <?php filesInDir('d:\policy'); function filesInDir($tdir) { echo ("<p><h1>List of files in ($tdir):</h1></p><hr><br />"); $dirs = scandir($tdir); foreach($dirs as $file) { if (($file == '.')||($file == '..')) { } elseif (is_dir($tdir.'/'.$file)) { filesInDir($tdir.'/'.$file); } else { echo $tdir.'/'.$file.' --- '.date("F d Y H:i:s", filemtime('$file'))."<br>"; } } } ?>
  5. I upgraded to PHP Version 5.3.4 today and I did a manual install. Everything worked until I renamed the php.ini-production to php.ini. I've followed the the recommended adjustments to the file, but after I did I started receiving - 500 - Internal server error message. I have several different manuals I've been using for configuring the ini file and I'm not sure what is right. Does anyone have a list of recommended changes to the ini file? Is there a setting in there that will allow directory listing - what I'm trying to figure out? I can run scripts like the one below fun. <?php $ip=@$REMOTE_ADDR; $ip=$_SERVER['REMOTE_ADDR']; echo "<b>IP Address= $ip</b>"; ?>
  6. I am trying to list the contents of different directories and I am having zero success. I have tested my PHP installation with phpinfo and through the PHP manager in IIS and it works. I am using IIS 7.5 and Win 2008 R2. I've made some basic scripts like what IP address does the machine have and they work. But, when I run the directory listing script in the root of the server it doesn't display any information. When I place the script in another directory it wants to download the file. Here is the script I am using to display the directory contents. It came from another user on the phpfreaks. $f = 0; $d = 0; // Open $var['path'] directory if ($handle = opendir($var['path'])) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && is_dir("$var[path]/$file")) { // $file is a directory $dirList[$d] = $file; $d++; } elseif ($file != "." && $file != "..") { // $file is not a directory $fileList[$f] = $file; $f++; } } closedir($handle); } @sort($fileList); @sort($dirList); for ($x = 0; $x < $d; $x++) { $html .= "<a href=\"{$var['url']}/fileDir.php?dir=$dirList[$x]\">$dirList[$x]/</a><br>\n"; } for ($x = 0; $x < $f; $x++) { $html .= "<a href=\"{$var['url']}/fileEdit.php?file=$fileList[$x]\">$fileList[$x]</a><br>\n";} I have checked "I think" all the different settings I could and I cannot figure out why it won't display the directory contents. Could it be a rights issue? Right now I am IUSR to access the site, but I will be using windows authentication. Any information would be helpful. Thank you.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.