Search found 60 matches
- Wed Nov 14, 2007 9:51 am
- Forum: PHP - Security
- Topic: accessing password protected directories
- Replies: 2
- Views: 878
- Wed Nov 14, 2007 9:24 am
- Forum: PHP - Security
- Topic: accessing password protected directories
- Replies: 2
- Views: 878
accessing password protected directories
I've password protected a directory in my site, but I want a php script to be able to access it to download a file from it. How can I do this? Here is the download script: $fname = "file.mxp"; $fpath = "folders/$fname"; $fsize = filesize($fpath); $bufsize = 20000; header("HT...
- Tue Oct 16, 2007 9:49 pm
- Forum: PHP - Code
- Topic: Get time since given date
- Replies: 1
- Views: 461
I figured it out:
gets difference in seconds
Code: Select all
$created = strtotime($info['creationdate']);
$now = strtotime("now");
$difference = $now-$created;- Tue Oct 16, 2007 9:14 pm
- Forum: PHP - Code
- Topic: Get time since given date
- Replies: 1
- Views: 461
Get time since given date
I am trying to find the amount of time that has passed since a given date (retrieved from a database), but I'm quite new to PHP date functions. I found this: $dateSrc = $info['creationdate']; $dateTime = new DateTime($dateSrc); The date will be formatted like this: "15:30:14 Oct 16, 2007 PDT&qu...
- Mon Sep 03, 2007 6:19 pm
- Forum: PHP - Code
- Topic: Edit document, not permissions
- Replies: 11
- Views: 820
Re: Edit document, not permissions
Hey, thanks for the replies, to volka, the output was: -rw-r--rw- uid:32276 gid:32277 xmlFile.xml and to VladSun I don't know how to find another site on the same server, but I imagine it would error, I was just hoping wouldn't have to change the permissions but that's making me change the permissio...
- Fri Aug 31, 2007 2:59 am
- Forum: PHP - Code
- Topic: Edit document, not permissions
- Replies: 11
- Views: 820
- Thu Aug 30, 2007 8:37 pm
- Forum: PHP - Code
- Topic: Edit document, not permissions
- Replies: 11
- Views: 820
Edit document, not permissions
I am trying to create a script that updates a file with new information, and I don't have to do anything to the information, I just write it directly to the page and I'm done, and I'm using the fwrite method right now but that's making me change the permissions of the file to allow "Everyone&qu...
- Mon Aug 27, 2007 9:12 pm
- Forum: PHP - Code
- Topic: write code to file
- Replies: 15
- Views: 661
- Mon Aug 27, 2007 8:56 pm
- Forum: PHP - Code
- Topic: write code to file
- Replies: 15
- Views: 661
I've never heard of that, but if you mean Sudo as in http://www.gratisoft.us/sudo/, I don't think will work because I'm not the system administrator, I use a hosting service so I don't think I can set that up
- Mon Aug 27, 2007 8:32 pm
- Forum: PHP - Code
- Topic: write code to file
- Replies: 15
- Views: 661
- Mon Aug 27, 2007 7:20 pm
- Forum: PHP - Code
- Topic: write code to file
- Replies: 15
- Views: 661
- Mon Aug 27, 2007 7:02 pm
- Forum: PHP - Code
- Topic: write code to file
- Replies: 15
- Views: 661
write code to file
I am looking for a way to write code to a file, and I have found the fwrite method but to use that I have to change the file permissions to 666, is there any other method that lets me keep the permissions the same, in this case 644.
Thanks
Thanks
- Thu Sep 21, 2006 5:58 pm
- Forum: PHP - Code
- Topic: Downloading Files
- Replies: 9
- Views: 1072
- Thu Sep 21, 2006 5:02 pm
- Forum: PHP - Code
- Topic: Downloading Files
- Replies: 9
- Views: 1072
- Wed Sep 20, 2006 8:25 pm
- Forum: PHP - Code
- Topic: Downloading Files
- Replies: 9
- Views: 1072