I need to add a few variables to an image and save the file on my web server. Those variables change in a few days so I also need a check if it is older then x days. How can I code that?
Something like: http://www.sitepoint.com/article/watermark-images-php/ Water marks images on the fly. Can be changed to just add text some place.
No worries, I can add text to image, I don`t know how to save the image to my server and update in every 7 day.
Well updating every 7 days would be a mySql table and a cron job (checks the timestamp against current date and runs a function against the filename if it's so much apart). And saving it is no different than displaying it, except you take the data returned from the display function and write it to a file. . . Something like: $thumb = imagecreatetruecolor(100, 100); Imagejpeg($pic,"pic.jpg"); ImageDestroy($pic); PHP: I do know that you need the correct permissions to save the file of course. . .
cronjob is a good option to do a task automatically. It will just call the script after a particular time interval.