vijdev Posted May 1, 2010 Share Posted May 1, 2010 i need the following to work: 1.post a requirement 2.requirement can be edited first 3 days of posting 3. after 3 days, the edit link or button needs to be seen but not clickable thanks! Quote Link to comment https://forums.phpfreaks.com/topic/200348-deactivate-link-based-on-condition/ Share on other sites More sharing options...
mikesta707 Posted May 1, 2010 Share Posted May 1, 2010 if (condition) echo "<a href=\"somelink.php\">link text</a>"; else echo "link text"; without more info and the code you currently have, I can't give a more definitive answer than this Quote Link to comment https://forums.phpfreaks.com/topic/200348-deactivate-link-based-on-condition/#findComment-1051424 Share on other sites More sharing options...
litebearer Posted May 1, 2010 Share Posted May 1, 2010 Psuedo code $post_date = timestamp of the date requirement was originally posted $now_date = current timestamp $diff = $now_date - $post_date $three_days = 24 * 60 * 60 if ($diff > $three_days) { requirement }else{ <a href"blah_blah"> requirement </a> } ----------- Quote Link to comment https://forums.phpfreaks.com/topic/200348-deactivate-link-based-on-condition/#findComment-1051426 Share on other sites More sharing options...
Ken2k7 Posted May 1, 2010 Share Posted May 1, 2010 litebearer, $three_days is more like 1 day. Quote Link to comment https://forums.phpfreaks.com/topic/200348-deactivate-link-based-on-condition/#findComment-1051434 Share on other sites More sharing options...
tomfmason Posted May 1, 2010 Share Posted May 1, 2010 Are you just wanting someone to write the code for you? If so, post this in the freelance board Quote Link to comment https://forums.phpfreaks.com/topic/200348-deactivate-link-based-on-condition/#findComment-1051440 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.