Search found 23 matches
- Mon Apr 27, 2009 4:08 pm
- Forum: Coding Critique
- Topic: Review of a File Manager
- Replies: 18
- Views: 12040
Re: Review of a File Manager
Ahhh...now I get it! Thanks a lot pickle, that code worked beautifully. I'm not sure what was up with my server before, but it works now. Thanks again.
- Wed Apr 22, 2009 7:34 pm
- Forum: Coding Critique
- Topic: Review of a File Manager
- Replies: 18
- Views: 12040
Re: Review of a File Manager
Sorry if I wasn't clear, I certainly don't want ../ to be allowed. However for some reason the code is allowing '../', and './..', which leads to the same directory is denied. Every other folder returns the correct result, child folders are allowed, and parent folders are denied. Plus, when I upload...
- Sat Apr 18, 2009 9:43 am
- Forum: Coding Critique
- Topic: Review of a File Manager
- Replies: 18
- Views: 12040
Re: Review of a File Manager
Oops.....It would have helped if I placed that code after $dir_to_read was set..... Now I get different results: Directory NOT OK realpath: C:\Apache2.2\htdocs\filemgr\_notes dirname: C:\Apache2.2\htdocs\filemgr dir_to_read: ./_notes/ $_GET[DIR]: ./_notes Directory OK realpath: C:\Apache2.2\htdocs\f...
- Fri Apr 17, 2009 2:25 pm
- Forum: Coding Critique
- Topic: Review of a File Manager
- Replies: 18
- Views: 12040
Re: Review of a File Manager
Here are the printouts of realpath($fs_dir) and dirname(__FILE__) under various directories: Directory: './' realpath($fs_dir): C:\Apache2.2\htdocs\filemgr dirname(__FILE__): C:\Apache2.2\htdocs\filemgr Directory '../' realpath($fs_dir): C:\Apache2.2\htdocs\filemgr dirname(__FILE__): C:\Apache2.2\ht...
- Thu Apr 16, 2009 8:37 pm
- Forum: Coding Critique
- Topic: Review of a File Manager
- Replies: 18
- Views: 12040
Re: Review of a File Manager
Thanks for the tip pickle, but I can't seem to get it to work. Just as a test, I stuck this in at line 38 (refer to code on first post): $fs_dir = dirname(__FILE__).$dir_to_read; if(strpos(dirname(__FILE__),realpath($fs_dir)) === 0) {echo('Directory OK');} No matter what the directory is, 'Dire...
- Thu Apr 16, 2009 12:57 pm
- Forum: PHP - Code
- Topic: mailer form
- Replies: 1
- Views: 244
Re: mailer form
I think you can use the ini_set() function for this.
You should be able to do something like this:
You should be able to do something like this:
Code: Select all
ini_set ("SMTP", server address);
ini_set ("sendmail_from", email address you are sending from);
- Thu Apr 16, 2009 12:47 pm
- Forum: PHP - Code
- Topic: Record date to MySQL using PHP
- Replies: 2
- Views: 115
Re: Record date to MySQL using PHP
I think you have to use date("d-M-Y",time()) instead of current_time, I don't know if PHP uses it as it didn't work for me when I tried it. Regardless, you have to concatenate the date properly and put quotes around it: $sql = "update contacts set " . "address='$address', ...
- Thu Apr 16, 2009 9:22 am
- Forum: Coding Critique
- Topic: Review of a File Manager
- Replies: 18
- Views: 12040
Re: Review of a File Manager
Thanks for taking a look at it PCSpectra. I just renamed it over ftp, but it is something that I do have to fix. (Check if index.php is under directory './', if so, hide it?) How could I check the location of the directory currently being viewed relative to the location of index.php (essentially the...
- Wed Apr 15, 2009 7:28 pm
- Forum: Coding Critique
- Topic: Review of a File Manager
- Replies: 18
- Views: 12040
Re: Review of a File Manager
Thanks for the input all, I guess I'm going to learn AJAX now
- Wed Apr 15, 2009 6:52 pm
- Forum: PHP - Code
- Topic: PHP Code to detect users browser for simple uses
- Replies: 6
- Views: 775
Re: PHP Code to detect users browser for simple uses
Use the function strpos() : <?php if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') == false) { //Code to execute when the user is not using Firefox } else { //Code to execute when the user is using Firefox } ?> I changed the code to search for 'Firefox' instead of '...
- Wed Apr 15, 2009 4:38 pm
- Forum: PHP - Code
- Topic: PHP Code to detect users browser for simple uses
- Replies: 6
- Views: 775
Re: PHP Code to detect users browser for simple uses
Are you aware of the of the $_SERVER['HTTP_USER_AGENT'] variable (I think that's the right one, if not look here: http://us.php.net/manual/en/reserved.variables.server.php for all the $_SERVER variables.) It basically returns a string that has the user's browser and version and some other info. IE i...
- Tue Apr 14, 2009 9:59 pm
- Forum: Coding Critique
- Topic: Review of a File Manager
- Replies: 18
- Views: 12040
Re: Review of a File Manager
Yeah, I've been thinking about using AJAX for a little while, but it just seems like such a daunting task to try to implement it, especially since I've never used much of it before. Would the advantages really be worth the work?
- Tue Apr 14, 2009 4:28 pm
- Forum: Coding Critique
- Topic: Review of a File Manager
- Replies: 18
- Views: 12040
Review of a File Manager
I know there are probably dozens of file managers out there that are ten times better than this one, but this is the first practical PHP application I have written, and I wanted to get some criticism from the community in terms of practicality, as I have a long list of features I want to add but am ...
- Tue Apr 14, 2009 3:48 pm
- Forum: PHP - Code
- Topic: Font color for key based on modif date ?
- Replies: 2
- Views: 121
Re: Font color for key based on modif date ?
Hi Peuplarchie, I played with the code you provided and got something working: The following will echo the date the given file ($file) was last modified, colored accordingly using CSS: if (time() - filemtime($directory.$file) < 604800) { echo '<span style="color:#DB1212;">'.$file.' w...
- Mon Apr 13, 2009 2:38 pm
- Forum: PHP - Code
- Topic: Tracking file upload progress
- Replies: 1
- Views: 533
Tracking file upload progress
Hi all, I'm currently writing an application that allows a user to upload a file using a simple form. I'm am trying to add a progress bar that can track the progress of the upload. I've looked around the net and have seen that "PHP V5.2 added hooks for developers to take advantage of tracking f...