a code for nightpharmacy

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
hasanoca
Forum Newbie
Posts: 9
Joined: Fri Mar 05, 2010 4:42 am

a code for nightpharmacy

Post 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?
pbs
Forum Contributor
Posts: 230
Joined: Fri Nov 07, 2008 5:31 am
Location: Nashik, India
Contact:

Re: a code for nightpharmacy

Post by pbs »

Yes you can do it by cron job.
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: a code for nightpharmacy

Post by papa »

Don't need cron job, just use time and dates.
hasanoca
Forum Newbie
Posts: 9
Joined: Fri Mar 05, 2010 4:42 am

Re: a code for nightpharmacy

Post 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.
Post Reply