hi i have PHP simple script in which i add only news, i need a formula in which it will do the following 1. for any news messages or news added within 12 hours from the previous one it will show it as news and it will ad new near that message
You need to store timestamp (you can access timestamp via time() function) and store it in your news database. When news listing you will check this timestamp with operators.
like
if ($timestamp > time() - 86400) echo 'new';
You should store the news' timestamp. When you display your news you should check the difference between current time and saved timestamp. If this difference is less than a day you should display new.gif.