codygoodman Posted August 23, 2007 Share Posted August 23, 2007 http://www.businesstips101.com/news/howoldareyouinseconds2.php ok it's not exact.. but it will be soon I need to know how to use the mktime() function to figure out how many days there were from a past date to the end of that year.. Then I can make it EXACT... also some info on making it live and refresh every half second to show in realtime how old someone is in seconds... then finally how to strip out harmful code... Thanks! Cody Link to comment https://forums.phpfreaks.com/topic/66288-solved-how-old-are-you-in-seconds-script/ Share on other sites More sharing options...
source Posted August 23, 2007 Share Posted August 23, 2007 http://www.businesstips101.com/news/yourageinseconds2.php?name=%22%3E%3Cmarquee%3Eownd&bornmonth=1&bornday=1&bornyear=1&action2=Submit Link to comment https://forums.phpfreaks.com/topic/66288-solved-how-old-are-you-in-seconds-script/#findComment-331604 Share on other sites More sharing options...
keeB Posted August 23, 2007 Share Posted August 23, 2007 ok how about this: <?php class Days { static function ago($days) { $time = $days * (24*60*60); $diff = time() - $time; return date("Y-m-d", $diff); } } print Days::ago(365); ?> Link to comment https://forums.phpfreaks.com/topic/66288-solved-how-old-are-you-in-seconds-script/#findComment-331605 Share on other sites More sharing options...
agentsteal Posted August 23, 2007 Share Posted August 23, 2007 Array: http://www.businesstips101.com/news/yourageinseconds2.php?name[] Cross Site Scripting: http://www.businesstips101.com/news/yourageinseconds2.php?name=<marquee><h1>vulnerable</marquee> Cross Site Scripting: There is Cross Site Scripting if the Expect header contains code. Link to comment https://forums.phpfreaks.com/topic/66288-solved-how-old-are-you-in-seconds-script/#findComment-331690 Share on other sites More sharing options...
codygoodman Posted August 23, 2007 Author Share Posted August 23, 2007 Yeah the XSS... I forgot how to strip tags... lol it's just striptags() isnt it? alright.. im working on it... Link to comment https://forums.phpfreaks.com/topic/66288-solved-how-old-are-you-in-seconds-script/#findComment-332396 Share on other sites More sharing options...
codygoodman Posted August 23, 2007 Author Share Posted August 23, 2007 alright... here's the full code for my first ever app: <?php //get todays day $day2 = date ("j"); //get todays month $month2 = date ("n"); //get todays year $year2 = date ("Y"); $years = $year2 - $bornyear; /* 2007 - 1991 = 16 */ $yearindays = $years * 365; $months = $month2 - $bornmonth; /* 8 - 6 = 2 */ $monthindays = $months * 30; $totaldaysborn = $yearindays + $monthindays + $bornday; $hoursborn = $totaldaysborn * 24; $minutesborn = $hoursborn * 60; $secondsborn = $minutesborn * 60; ?> Now I'm not quite sure how the code above would play into this... Please Explain.. Thanks, Cody Link to comment https://forums.phpfreaks.com/topic/66288-solved-how-old-are-you-in-seconds-script/#findComment-332405 Share on other sites More sharing options...
Fadion Posted August 23, 2007 Share Posted August 23, 2007 I guess this should be in PHP Help. About the 'donation', really u think someone is going to donate for such a script? People donate in online communities or non-commercial stuff who really help them. What is the aim of such a script anyway? Why should i know my age in seconds when i know it in a very more readable format? Also about the stats and counter. Im sure u can do a counter in php and if not there are tutorials for that. Google Analytics is a great free tool for keeping track of site stats. And why are u showing stats of your site to users? Arent they supposed to be confidential!! Link to comment https://forums.phpfreaks.com/topic/66288-solved-how-old-are-you-in-seconds-script/#findComment-332426 Share on other sites More sharing options...
codygoodman Posted August 23, 2007 Author Share Posted August 23, 2007 ok... i think I've got everything.. and yeah I had doubts about the donation thing... so i'm just putting adsense there. I just made this app to learn php a little better, and use functions in different ways. The counter... I just put it there now lol, but im about to change it.... Thanks for all the help guys! - Cody Link to comment https://forums.phpfreaks.com/topic/66288-solved-how-old-are-you-in-seconds-script/#findComment-332433 Share on other sites More sharing options...
keeB Posted August 24, 2007 Share Posted August 24, 2007 Don't listen to GuiltyGear -- I don't know where (s)he gets off telling you what to put on YOUR site. Silly things like this get attention all of the time, and congratulations on completing your first script Link to comment https://forums.phpfreaks.com/topic/66288-solved-how-old-are-you-in-seconds-script/#findComment-332680 Share on other sites More sharing options...
Fadion Posted August 24, 2007 Share Posted August 24, 2007 Don't listen to GuiltyGear -- I don't know where (s)he gets off telling you what to put on YOUR site. And why must he listen to you..if u said something clever??!!! Stuff like 'wow very good' or 'looks awsome' arent much of a critic. Just pointed out some things i didnt like. Link to comment https://forums.phpfreaks.com/topic/66288-solved-how-old-are-you-in-seconds-script/#findComment-333557 Share on other sites More sharing options...
Recommended Posts