Page 1 of 1

2 Easy Questions(I Think!)

Posted: Tue Nov 08, 2005 11:16 pm
by nparekh
Hi guys

Firstly thanks for all who have helped me here - made tasks so much easier! :)

Now I have some php code on my server which takes a bunch of text files and saves it to a directory on the server.

Code: Select all

if (is_uploaded_file($_FILES['words']['tmp_name'])){
            move_uploaded_file($_FILES['words']['tmp_name'],$SCRIPT_PATH."task_$suffix/words.txt");
What I would like to do is make two copies of these files. One to be saved in the directory listed above and another to a test folder

- test_$suffix/words.txt

How do I get a copy saved? I can't seem to get it to work

The other question I have is how can I get a cron job to run every 7 seconds? At present I'm only able to run it every 1 minute.

Thanks in advance!

Nikhil

Posted: Tue Nov 08, 2005 11:28 pm
by m3mn0n
1. Duplicate the moved_uploaded_files line and change the directory name.

2. Cron is built to run every minute so that's not possible.

I suggest redesigning your script or using something like sleep(7) and then header($path_to_self)

Posted: Tue Nov 08, 2005 11:37 pm
by nparekh
Hi Sami

Thanks for replying.

1) I fixed the uploading of files to two directories so that works great:)

2) I'll have to investigate the sleep command - there might be a way to make the php script run a few times in a minute. I'll get my friend to look at it:)

Thanks in advance!!

Regards,

Nikhil