need assistance with php code that rotated my daily image
Moderator: General Moderators
need assistance with php code that rotated my daily image
Please visit my homepage to understand: http://www.danscartoons.com where that cartoon was recently being rotated by a php script. After recently redesigning my page, Frontpage had caused me to lose my php script or overwrite it via a command I inadvertently activated. The php script rotated my images every 24 hours at 2am eastern time. I am now, not sure what to do! I could use anyone's assistance, e-mail me direct if you wish as my address is on my homepage. The image source code used, was http://danscartoons.com/cotd/dailycartoon.php and I could give you my webhost's URL and my login & password if you can help me. Otherwise I would have to post a new cartoon manually, which is time consuming. I scanned 365 images into a folder that I uploaded to my web folder and then published to my web host and the php script ran things from my web server. Can anyone assist? Thanks for feedback.
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
cron job may be what your looking for. or you could use a database that holds all the cartoons urls then use date() to tell the time and if the time in the database is 1 day older than the date() time then you could update the database with that days display image and then the image would be displayed.
i know i described that poorly but maybe you get the idea?
i know i described that poorly but maybe you get the idea?
Wouldn't something like this be sufficient and easier?
Results:
Using mktime() to easier set the date, date() to get the day of year and applying it into an image src. Requires the images to be named 1.jpg, 2.jpg, 3.jpg, 4.jpg etc. though...
(
JAM | Rearranged the code to look more like wanted in this this thread
Note that this works differently than the script(-parts) you posted in the other thread. This generates a number based on the todays date +1 hours, and puts that directly into an image html reference.
)
Code: Select all
<?php
$number = date("z", mktime(2, 0, 0, date("m"), date("d"), date("Y")));
echo '<img src="./images/dc'.$number.'.gif" />';
?>Code: Select all
<img src="e;./images/dc149.gif"e; />(
JAM | Rearranged the code to look more like wanted in this this thread
Note that this works differently than the script(-parts) you posted in the other thread. This generates a number based on the todays date +1 hours, and puts that directly into an image html reference.
)