How to prevent bots spamming your forms
Today I’m going to explain how you can prevent bots submitting spam to your online contact forms, registrations and submission forms in general. We will use PHP and GD to achieve this. The following is the code for the image.php script with the comments where needed. Read more
Exabytes and time
I was doing one freelance work where I had to use LAMP technology. So my client has ordered hosting from Exabytes. Interestingly I had some bugs on theirs servers. I digged some more and I find out that their PHP time is wrong. Here’s the screenshot:
As you can see from the screenshot the server shows a date with more then 1 day difference! Well, I’ve never bothered to check if the servers were from US or local, I was under impression that they were local. Well, seems like not! So that’s how I get a almost a day difference in dates!
I used very basic date functions to get the date shown on their servers. The code is taken from php.net and now I need to add the difference to get Malaysian time.
I will post my solutions here, stay tuned!
Update: I used very simple code:
$h = “-8″;// Hour for time zone goes here e.g. +7 or -4, just remove the + or -
$hm = $h * 60;
$ms = $hm * 60;
if (!$date) {
$date=date(”Y-m-d”);
$getdate = gmdate(”Y-m-d”, time()-($ms));
}
How to ignore files in CVS
At my current place we use Eclipse as our main IDE for Java Application Development and CVS for versioning. The developers have reported that they have troubles with .classpath and .project files when using Eclipse and CVS. So I was told to find a way to ignore/stop letting in those files in CVS.
The first thing I found was .cvsignore file, you can put unwanted file names in the .cvsignore file and that’s it. However this works only for Eclipse user’s PC, for each project different .cvsignore file.
ATM Monitoring in Ambank
Recently, I had the opportunity with three other vendors/freelancers to come up with a solution for their M$ ACCESS based “application” which record downtime of their ATMs. Basically it’s a .mdb file which is shared on a ms win server folder.
Before everything else, I was surprised how they “monitor” their ATM machines! They literally watched the ATM reporting screen to see if the ATM was down. I mean, a person is allocated for this task - just sit and stare at the monitor, if the ATM status goes down he needs to open their “application” and enter the downtime.
Anyway, they did a small presentation of their usage of this “application” and their expectation. They wanted some applications which will replace theirs. “Replace” not as in enhance or add-on new functions. They just want to keep the way they “monitor”.
I must note that I was contacted long before this meeting with regard to this matter and I was planning to use Perl/Shell scripting in Linux to do all of this with a LAMP interface for reporting purposes. But, it turns out that all their infrastructure as well as IT team is pro-Microsoft. What to do? They just want it in some Microsoft .NET or Visual Basic (is it the same now?). So, unfortunately we fail.
We proposed to them a fully automated uptime/downtime tracking facility with auto generation of reports in Excel/PDF.
What I don’t understand is why they find it all right to have somebody just sit and watch the ATM monitor screen. It’s wasting resources for nothing, instead of hiring/training a person to use Open Source stuff and make everybody’s life easy?
And, of course, some extra cash for me?
