Tag Archives: coding

Back to Coding!

Taun ini lumayan banyak ngoding sendiri (walaupun cm minor changes), but it’s fun and challenging! Asik juga ternyata cari-cari error dan ada kepuasan tersendiri pas berhasil menemukan di mana letak error tsb (norak ya, padahal kadang2 cm simple things). Masih ingat post sebelumnya? Sampai sekarang kalau coding ya paling seputar PHP & C#. For the latter, if I could choose, I want to use VB.NET. Sayangnya, gw gak bisa milih. 😛 Continue reading

PHP: How to Get Previous Year, Current Year, and Next Year

Because I can forget things easily if I don’t use it often and I’m sure this will be used again in the future, I should make a note about it.

Getting certain year using this method is very useful when we make a dynamic application, like in registration form in which we want to limit the age of the registrants, we can use this.

  • To get current year: date(‘Y’);
  • To get previous year: date(‘Y’, strtotime(‘-1 year’));
  • To get next year: date(‘Y’, strtotime(+1 year’));

If you want to get last two year or the next two year, just change -1 to -2 or +1 to +2

Deadline for Myself ;)

51-time-clockLast weekend, I was challenged to create a simple desktop application to login to a website and get the data. I thought it would be easy, just check the parameters from the page and post the values. But, it wasn’t that simple. I tried many times but always failed.

I used many different examples found on the Internet, but none of them worked well. I’ve understood how the major flow to POST data to the website and get the data after that. I also already knew how to use the data for my purpose, but the problem was my program couldn’t login to the system.:(( Continue reading