Search found 60 matches

by Clukey
Wed Nov 14, 2007 9:51 am
Forum: PHP - Security
Topic: accessing password protected directories
Replies: 2
Views: 878

Wow, awesome, I didn't realize that. Thanks
by Clukey
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...
by Clukey
Tue Oct 16, 2007 9:49 pm
Forum: PHP - Code
Topic: Get time since given date
Replies: 1
Views: 461

I figured it out:

Code: Select all

$created = strtotime($info['creationdate']);
$now = strtotime("now");
$difference = $now-$created;
gets difference in seconds
by Clukey
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...
by Clukey
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...
by Clukey
Fri Aug 31, 2007 2:59 am
Forum: PHP - Code
Topic: Edit document, not permissions
Replies: 11
Views: 820

Well, I've heard that too, but unfortunately I need the same amount of permissions to use chmod as I do to use fwrite so it doesn't really help
by Clukey
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...
by Clukey
Mon Aug 27, 2007 9:12 pm
Forum: PHP - Code
Topic: write code to file
Replies: 15
Views: 661

Ok, well I didn't think it would be such a big deal, but since I'm not ROOT I guess I'll just change the permissions.

Thanks for the help
by Clukey
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
by Clukey
Mon Aug 27, 2007 8:32 pm
Forum: PHP - Code
Topic: write code to file
Replies: 15
Views: 661

So, if I am understanding you right, since I am on a shared server it isn't possible to edit a file without changing the permissions of the file I am trying to edit. Is that right or did I miss something cause that seems like something that should be possible?
by Clukey
Mon Aug 27, 2007 7:20 pm
Forum: PHP - Code
Topic: write code to file
Replies: 15
Views: 661

but the reason I can't use fwrite is because for some reason the server sees the script's owner as being different than the owner of the file I am trying to write to so I have to change the permissions to let the "world" edit it, and for the same reason chmod() won't work
by Clukey
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
by Clukey
Thu Sep 21, 2006 5:58 pm
Forum: PHP - Code
Topic: Downloading Files
Replies: 9
Views: 1072

Well then is there any way to duplicate the file into another folder temporarily and download it from there?
by Clukey
Thu Sep 21, 2006 5:02 pm
Forum: PHP - Code
Topic: Downloading Files
Replies: 9
Views: 1072

Right, but in firefox when it brings up a download file dialog box it shows the relative location to the file.
by Clukey
Wed Sep 20, 2006 8:25 pm
Forum: PHP - Code
Topic: Downloading Files
Replies: 9
Views: 1072

Thanks, that works, but is there any way to do this and hide the location of the file?