Page 1 of 1

a code for nightpharmacy

Posted: Fri Mar 05, 2010 4:49 am
by hasanoca
Hello
I need to put in order the pharmacy shops in my town, their phones and addresses so that people visiting my site will know which pharmacy shop is going to be open that night. The night pharmacy is a different shop everyday and I want to show people which one stands duty that night. I have prepared the list and put it in mysql database. I have given each shop a unique number and by changing the number I can change all the information displayed. However, I want it to change automatically at a certain time of the day. Is this possible?

Re: a code for nightpharmacy

Posted: Fri Mar 05, 2010 4:55 am
by pbs
Yes you can do it by cron job.

Re: a code for nightpharmacy

Posted: Fri Mar 05, 2010 8:43 am
by papa
Don't need cron job, just use time and dates.

Re: a code for nightpharmacy

Posted: Sun Apr 04, 2010 5:27 am
by hasanoca
Thank you very much for your replies.

First I tried to do it with cronjobs but it didn't work. I have root access and use cpanel. I used the cpanel interface to add it as a cronjob. First I arranged the date and time and then I added the following command
vi
:imap jj <esc>
:read /home/denepan/public_html/goster-ozel.php
28j
11l
xi1jj
:w! goster-ozel.php
:q
exit
Using the vi command I hoped to edit the goster-ozel.php, which contains the code. The code worked when I tried it manually with SSH. But it didn't work with cpanel cronjobs.

Then I tried if/elseif command. Now it works but an unwanted and unexpected element is displayed, number "1" appears above the table. I don't know why it appears there. You can find the details in my second post, number 1 problem.