alamin ahmed: a typical geek 2.0

ideas.experiments.thoughts.life

home blog about me
twitter: aahmed753

Archive


Topics:

Digg suspended my account. Here's why...

posted on: January 4, 2009 at 01:59 pm


I've been digg user for years now. Love it for the same reason other millions do. However, few days ago when I attempted to login, it was saying that my account is invalid. I contacted the support and they informed me that my account was suspended.

This was a huge surprise to me. It turns out, one of my comment was the reason for the suspension. Before quoting the comment, let me put things into context first. Recently few of my comments were literally mis-placed! I read an article, and when I post a comment for that article, for some reason comment is posted to the article before or after it. Another words, if the article I'm reading is about Obama, the comment goes to the article that is about 10 greatest Photoshop tricks. As you can imagine how irrelevant my comment would be in such case. Not surprising to the least, Digg users bury my comment and write replies comparing my intellect with McCain's computer knowledge. Just to throw that in, I am Software Engineer and have been working in the field last five years.

When this happened first, I thought it was extremely wired, but accepted that I may have mistaken. However, when second time this happened, as anyone would, I got really pissed. So here is the comment that banned my account: "This is the second time I have posted comment for article and wind up being in another. fucking digg needs to get their website's dick in place."

If you have ever used digg and read through comments, you will know that these kind of language is used all over the comments in digg.com

So replied to my email, digg throws me their terms of services:
[[5.1 By way of example, and not as a limitation, you agree not to use the Services: to abuse, harass, threaten, impersonate or intimidate other Digg users; Also, note that in our Terms of Service, we reserve the right to, “Digg may remove any Content and Digg accounts at any time for any reason (including, but not limited to, upon receipt of claims or allegations from third parties or authorities relating to such Content), or for no reason at all.]]

They want me to re-affirm the service agreement, in another word, appologize for my comment, in which case they will activate my account.

Now, I honestly don't have any problem with their or any other service agreement. Companies like them, I am sure they have find many ways to close the holes to protect them. But as a principle, I wanted to know which part of my comment violated the TOS. I replied back that, my comment DID NOT abuse, harassed any other digg user. Rather this comment was aimed to the digg.com for their system engine.

Here is my last reply to them, from which point digg stopped responding:
"I need to know what context/part of the comment that was so offending, and to whom it was offending, for which my account was banned. So that I can judge if I want to be part of this community or not. I love digg because of the social aspect and specially for freedom of speech in the comments, where I have seen people say all sorts of things that clearly offends a religion (specially my religion), faith, system or say, presidential candidate.

Are you simply exercising your right to remove an account "for no reason at all"? or someone at digg took my comment too personally?

I don't have any problem with your service agreement. I don't have to re-affirm it. I know you guys have put lots of shitty disclaimers to protect yourself. It's the principal that I am interested in."


I have included the complete conversation in the bottom. I know if hundreds or even thousands of digg users like me are kicked out, digg will not have any negative impact on their business. I know I'm whining about it, and I can't change anything or make another individual stop using digg. Honestly, this is not my goal here. I just wanted to be heard. This was really surprise and heart broken for me. It is very hard for me not being part of the digg community anymore.

So much for Freedom of Speech.

here is complete email conversation



Parma Link | Comment(s)

Im a PC and I am in steroid?

posted on: September 22, 2008 at 01:08 pm

After two stupid episodes of Ads about nothing by Bill Gates and Seinfeld, Microsoft finally made few interesting and affective ads in their latest $300 million campaign. I actually love them!
Tagged: Microsoft   PC   Parma Link | Comment(s)

NYC Subway Islamic Ad Campaign stirs controversy

posted on: August 2, 2008 at 09:31 pm

ICNA SUBWAY AD CAMPAIGN

The New York Chapter of Islamic Circle of North America and its 877-WHY-ISLAM project have launched a subway campaign hoping to promote better understanding of Islam, which has garnered quite a bit of media attention. Campaign is set to start from this September 15th for about a month.

Mockup Concept of Subway Campaign
concept design

CNN Interview with ICNA Representative: Islam on Subway

Tagged: islam   Parma Link | Comment(s)

Crazy Driving in Saudi highway. Impossible!!

posted on: July 28, 2008 at 02:25 pm

Tagged: offbeat   saudi   driving   Parma Link | Comment(s)

iPhone made Objective-C popular

posted on: July 25, 2008 at 06:35 am

Objective-C? most developer didn't even know that such programming language existed, which is the primary programming language used for Mac OS X programming. Other programmers looked at it, then then turned away from it's bizarre use of square brackets. Objective-C never really got much attention from developers, that is until now.

iPhone SDK has been long anticipated by developers. Now that it's in the wild, only way to actually use it, is through Objective-C. Considering impact of iPhone platform and it's market, many amateur and big guns are driving into iPhone developers program. Screwing head with Objective-C, which probably will erase your memory with Java, C++ or any other programming language you used to code.

Tagged: iphone   objective-c   iPhone SDK   Parma Link | Comment(s)

iPhone is acting like Windows ME

posted on: July 24, 2008 at 10:40 am

Not allowing third-party software on iPhone was one of the biggest drawback and strength at the same time. Apple insisted that allowing door to thrid-party would instabilize the iPhone experience. Apple could've sworn that people be happy and satisfied with just the Phone, Internet Communicator and iPod. Who knew people would want to use iPhone as a tip calculator.

After using Mac for last two years, I almost forgot the that a computer can decide for itself to shutdown/restart/freeze when ever it wants. I forgot how often I used kicked my desktop tower, broke dozens of keyboards just out of frustrations. Well, it's all coming back to me now.

iPhone restarted on me more then 30 times since the upgrade of iPhone 2.0 and installing third-party software on it. Say hello to iPhone ME.

It seems to me that most of the problem is due to lack of memory management by these new amateur developers. Most of these new developers coming from programming languages that used to handle memory management (garbage collection) automatically. Even some one who developed for desktop Mac application, didn't need to care about memory leaking. And let me say from a developer point of view, memory management manually is not picnic.

Nevertheless, third-party software is a great thing that happened in iPhone version 2.0. Now I finally get to pay the waitress exactly 15% and take a break from iPhone while it restarts.

Tagged: iphone   iphone 2.0   Apple   Parma Link | Comment(s)

maximize iPhone's battery life.

posted on: July 24, 2008 at 01:30 am

10 hot and useful tips to maximize iPhone's battery life.

Apple Inc. claims that iPhone has 8 hours talk time, 250 hours of standby, 6 hours of Internet, 7 hours of video playback and 24 hours of audio playback!! These are very impressive numbers, except that claims has lots of strings attached which no one actually reads it.

Although, you may not get even close to these numbers, but I will attempt to provide all tweaks and settings to get as close as possible.  I have collected most of these tips from Apple's fine prints and some from support page of an iPod. Don't worry, I am not going to ask you to turn of Wi-Fi or other features that would simply cripple your iPhone.

  1. Brightness setting:  this alone can do the trick of getting most out your iPhone's (or any device for that matter) battery life.  Even though iPhone has bright and gorgeous screen, you may want to turn it down to get that screen playable little longer!
    How-to: "Settings" -> "Brightness" -> slide it to about one seventh
  2. Auto brightness: iPhone has built-in sensor that checks the lighting condition where ever you are and adjust the brightness accordingly.  This is sweet feature, but the sensor eats up battery life.
    How-to: "Settings" -> "Brightness" -> turn the "Auto-Brightness" switch "OFF"
  3. Auto-Lock: turn that display off as frequently as possible.  Make sure it is set to 1 Minute
    How-to: "Settings" -> "General" -> "Auto-Lock" -> "1 Minute"
  4. Auto detect Wi-Fi: iPhone has feature to
    How-to: "Settings" -> "Wi-Fi" -> "Ask to Join Networks" -> turn "OFF"
  5. Email Check frequency: this may not be suitable for lots of business or frequent email users, but it does save battery life.  You can set iPhone to check email every 15, 30, 60 minutes or do manual check.  Of course, ideal setting for saving battery would be "Manual", but you can also set to "Every hour"
    How-to: "Settings" -> "Mail" -> "Auto-Check" -> select "Manual" or "Every hour"
  6. Turn of some sounds: iPhone makes noise for about everything you do on it.  You can turn off some of these sound effects such as keyboard click noise and Lock Sound noise.  These two are really unnecessary for the most part.
    How-to: "Settings" -> "Sounds" -> "Lock Sounds" turn "OFF" and "Keyboard Clicks" turn OFF
  7. Turn of that Equalizer: yes, according to Apple, turning of Equalizer will save little battery time!
    How-to: "Settings" -> "iPod" -> "EQ" -> "Off"
  8. Turn of Sound Check: iPhone provides Sound Check feature to adjust music volume to keep consistent range for all songs.  Most of the time it does not work (at least for my songs).  So you can turn it off to save some juice.
    How-to: "Settings" -> "iPod -> "Sound Check" turn "OFF"
  9. Audio encoding: compress size of your music file for better cache purpose and encode using MP3 or AAC encoding. AIFF and some other formats are not good and eats up CPU cycles
  10. Room Temperature: Keep iPhone in room temperature and do not charge your iPhone while it is in carrying case or cover.  This keeps battery in ideal temperature even when charging.
Hope these tricks help you get more life out of your iPhone's battery.  Just as an additional note, Apple has also announced iPhone's battery replacement program for $79.99 + shipping.  read it here: http://www.apple.com/support/iphone/service/battery/

Tagged: iphone   tips   Parma Link | Comment(s)

10 must-know guidelines for iphone web app developers

posted on: August 31, 2007 at 12:00 am


I visited iPhone Tech Talks on 30th of August.  Initially I wasn't thrilled about it and didn't have much expectation .  However, I found the show to be very informative and fun.  I got to seat and chat with many developers who are actively working on lots of cool iPhone apps and services.

In the beginning of the show, they mentioned that we are in bidirectional NDA (Non Disclosure Agreement) contract.  I do not see any secretive information from Apple or iPhone's prospective, but Some developers had some interesting ideas which I'm not going to disclose.

There were bast information given in 5 hours lecture - from Developer's scenario to optimizing for iPhone and how iPhone's safari renders web pages. I tried to gather most of the valuable information and organized in category of guidelines.  Hope these helps!!

  1. Separation of contents:   
    1. Put all JavaScript on .js file and all styles on separate .css file.  
    2. Obvious explanation is for better coding and readability, but main advantage is that - this design practice improves loading speed on iPhone, specially on edge network.  This is because safari caches all css and js files when they are separate.
  2. Use Standards:  
    1. iPhone supports following standards: HTML 4.01, XHTML 1.0, DOM, CSS 2.1, some CS3, Javascript Ecmascript 3.  
    2. Does not support WML.  
    3. My tip, which they didn't mention but I think is good practice, is to use XHTML 1.0 Strict rules instead of HTML 4.01 and XHTML 1.0 Transitional.  This ensure most compatibility and speed of browser for rendering.
  3. Know the limitations:
    1. Resource limitations:
      1. 10MB for each text based files (each html, js, css).  This is huge, so I don't actually consider as limitation.
      2. 8MB for images such as tiff, gif, png
      3. 32MB for jpeg images.
      4. 2MB of animated gif. If the animated gif is larger, iPhone will simply show the first frame and won't animate.
      5. if a page is greater then 10MB, it may load, but would cut resources from any other open window, if available.
    2. Javascript limitations:
      1. as I mentioned 10MB file size.
      2. only 5 second of execute.  This is to ensure a script does not make the iPhone non responsive.  
        1. If the execute time is greater, it will through Exception.
        2. So put it on try catch block.
      3. Know that script maybe paused.  So when window is inactive your script is paused.  So javascript timer will not show accurate time when user leaves the safari or goes to different window.
    3. Plug-in limitations:
      1. No Java
      2. No Flash
      3. no SVG
    4. File System
      1. NO File System
      2. Upload button will be disabled and grayed out.
  4. Know what is supported: 
    1. Most of javascript functions, events are supported:
      1. window.open, target="_new", alert(), confirm(), prompt()
        1. even though alert, confirm and prompt are a bad way to send or receive information from users in real desktop browser, iPhone it's totally different case.  In fact it is encouraged.  The script window looks good and sexy.  Feels like real app window.
      2. Events:
        1. tap triggers onclick, onmousedown, onmouseup and onmousemove
        2. two finger triggers mousewheel
        3. all other events such as blur, focus, load, unload, reset, submit, change, abort are supported
        4. please note that you can not call blur or focus events using javascript.  But events will be fired when these events happens.
    2. Supported Files within web browser:
      1. Excel. Nicely converts to html and put separate sheets as tabs.
      2. Word.
      3. PDF. Does not support password protected files.
      4. Quicktime audio and video:
        1. H.264 base 2, 640x480 at 30fps
          1. Does NOT support B frames
        1. AAC-LC upto 48kHz
        2. mov, mp4, m4v, 3gp
        3. mpeg-4 part 2
      5. Canvas for animation and data driven content
        1. Canvas is now Standard
        2. Used to create all Mac OS Widget
        3. now supported by Opera, Firefox
        4. iPhone uses complete implementation
        5. iPhone's stock uses Canvas to animate and show data
    3. Built-in Fonts
      1. Ariel, Courier, Georgia, Trebuchet, Zapfino,Helvetica, Times, Verdana
  5. Scaling/Zooming and META tag:
    1. iPhone will scale a web page to 980x1091 first, then scale back to 320x480.  They use this technique for all web sites.
    2. iPhone looks for following meta tags for overriding default scaling:
        1. this will not scale at all and just render the page to 320 width
        1. initial-scale = 1 means 100%, 2 means 200% and so on.
      1. other values for contents
        1. user-scalable=yes/no
          1. if set to no, user can't pinch or zoom
        2. minimum-scale or maximum-scale
    3. Control zooming on every element of the HTML page
      1. use -webkit-text-size-adjust property to control zooming by double tapping to all html elements including div, table, body.
        1. -webki-text-size-adjust has following values:
          1. none: disable zooming
          2. auto: let Safari handle it
          3. %: set to a percentage
  6. Integrate with iPhone's app
    1. integrate with Google Map Application
      1. simply like using anchor with show me pizza!
      2. q parameter is for terms
    2. integrate with Phone App
      1. call us
    3. integrate with Mail App
      1. email me
  7. Understand iPhone's User Agent
    1. iPhone User Agents has following terms
      1. iPhone;U;CPU like Mac OS X;en 
      2. AppleWebKit/420 - gives WebKit version
      3. Version/3.0 -  3 for Safari 3 family
      4. Mobile/xxxx - iPhone Safari build number
      5. Safari
  8. Understand iPhone Safari's preference:
    1. This is important because developer needs to know that users can disable and enable some features from the iPhone's Setting.
      1. javascript can be turned off (on by default)
      2. pop-up block can be turned off
      3. cookies policy can be changed just like desktop Safari
  9. MISC. Tips:
    1. create rounded rectangle:
      1. user -webkit-border-radius css property to create nice rounded rectangle.
    2. create button or header
      1. user -webkit-border-image to create nice headers and buttons
    3. user javascript frameworks
      1. iUi (praised by the staffs)
      2. YUI (Yahoo library)
      3. dojo
      4. prototype
      5. JQuery
    4. use CS3 media query to detect iPhone when including css files
      1. iPhone returns "screen" and width value
    5. turn on server-side compression
      1. this alone can save up-to 50% of download time.
  10. DEBUGGING
    1. Turn on developer's menu for safari,learn how.
    2. Download nightly build Webkit which includes excellent and extended "Inspect Element" tool.  http://webkit.org/
    3. User Drosera (comes with nightly build webkit for only for Mac)  for debugging Javascript.
Tagged: web design   iphone   Parma Link | Comment(s)

SPAN-DIV Concept

posted on: August 24, 2007 at 01:21 am

If you are web designer, CSS should be your best friend by now.  If not, then you guys should get know each other better.  CSS certainly becoming a huge part of web development and future tends to lean toward  that direction as well.

W3C, organization responsible for web standards, are recommending heavier use of CSS - specially for presentation.  Some of the HTML tags already have been deprecated - center, string, u, s, font, etc.  Other tags are to follow.  If you read XHTML 2.0 specification you see special attention to CSS has been given and more HTML tags are pronounced deprecated.

CSS also helps keep your work flow and code clean and uncluttered.  Initially this advantage might not be apparent.  But as you read through this article, you will notice CSS is much readable and better way to design your complex web page.

SPANDIV concept:

My attempt on migrating to CSS may seem rather radical at first. I want to eliminate every HTML tags possible and represent them by DIV and SPAN tags only, hence SPANDIV.  Each of these elements will then use specific CSS class(es) to emulate HTML tags.

The idea is simple.  Instead of bold, I want to use bold.  Instead of

paragraph

, I want to use
paragraph


At first my approach may look tedious and more work.  But consider the following:

This is a paragraph with bold italic underlined text



This can be rewritten:

This is paragraph with bold italic underlined text.


You can start to see some advantage on using css class.  Using multiple classes, your code remains simple and uncluttered. 

Initially I started with this concept as an experiment to map HTML tags and attributes to CSS properties.  Then I realized, all most every HTML tags can be represented in CSS, except for action and some special tags- such as, form and it's element, link, images, etc.

I would not go through all tags in this article.  It would be pointless and boring.  By end of this article you would have pretty good idea to continue from there.

SOME CSS PREREQ:
In HTML world, you can break down elements into two groups - "block", here represented by DIV and "in-line", represented by SPAN.  In basic terms, block level elements creates a new line break and keeps it's child elements within it's self where as in-line elements does not create new line and does not have it's own "box" to keep elements within.

if you are not familiar with css at all, you might want to read up on it before you continue on this article.  My codes extensively use descendant sectors and adjacent sibling sectors.

Descendant Sectors:

.table .row .cell { float:left; } /* note space between class sectors */

this tells browser to apply 'float:left' to 'cell' class who is descended from 'row' who is descended from 'table' class.

Adjacent sectors:

.row.header {font-weight:bold;} /*note there are no space between .row and .header */

this tells browser to apply 'font-weight:bold' to only element who has these two classes assigned adjacently (ie.
)

If you understand these two sectors and have some basic CSS knowledge, you should not have problem following this article.

SOME BASIC FORMATTING:
paragraph are defined by setting bottom margin only. 

.paragraph, .p {margin-bottom:15px;}

Some of the most basic formatting are:

.bold, .b {
    font-weight:bold; }
.italic, .i {
    font-style:italic; }
.underline, .u {
    text-decoration:underline; }
.strike {
    text-decoration:line-through; }
.center {
    text-align:center; }
.indent {
    text-indent:2em; }


As you can see, these are all self explanatory and using simple css properties to achieve same result as their respected HTML tags.

now you can use these styles as follows:


    this is bold, this is
italic and strike and this is is this is underline



HEADERS
Header starts with a generic 'header' class, which only has top and bottom margin properties.
.header {
    margin:15px 0 15px 0;}


How big the header is defined by separate classes:

.biggest {
    font-size: 32px;
    font-weight:bold;}
.bigger {
    font-size:28px;
    font-weight:bold;}
.big{
    font-size:22px;
    font-weight:bold;}
.small{ font-size:14px;}
.smaller{ font-size: 12px;}
.smallest{ font-size:10px;}


As you can see you can have header from biggest (same as H1) to smallest (same as H6).  To use the headers in following way.

This is same as H1

This is same as H3

This is same as H5


You can add other formatting as well:

This is centered big header with italic and underlined


You can now also use the 'big', 'small' and other classes separately:

this is big and this is very very small

LISTING/BULLETS
all listing are defined by 'list' class:

.list { }

ordered list (ie.
    ) represented be 'ordered' class and unordered list (
      ) by 'unordered' class.
      Both type of list has the following common default properties:

      .list.ordered, .list.unordered {
          margin: 15px 0px 15px 25px;
          list-style-position:outside; }


      you define order list and unorder list by specifying list-style-type:

      .list.ordered { list-style-type:decimal; }
      .list.unordered { list-style-type:disc; }


      Now for items (
    • ) all you have to do is

      .list.ordered.item,
      .list.unordered.item { display:list-item; }

      Now you can start using your list:


         
      This is first Item

         
      This is second Item in bold



      Definition lists can be done easily:

      .list.defination { }
      .list.defination .term { }
      .list.defination .definition { margin:50px; }


         
      CSS

         
      Cascading Style Sheet



      TABLE
      In my previous post, I have talked a great detailed about creating tables using css - including three different approaches.

      .table {}
      .table .row { clear:float; }
      .table .row .cell { float: left; }
      .table .row.header { }
      .table .row.body { }


      creating a table


         

             This is header of the column
         


         

             Row 2, Column 1
             Row 2, Column 2
         




      MISC.
      .pre,
      .code {

          white-space: pre;
          font-family:monospace;}


      DISADVANTAGE OF SPANDIV CONCEPT:

      Technically there is no disadvantage.  However, W3C does not recommend this 'spandiv' solution - complete eliminating HTML tags.  Primarily  because some of the HTML tag has special meaning and other applications and services uses those meaning .  For example, header tags, such as H1, H2, and H3 are specially interest search engines.  They tend to use the context within these tags to rank web pages.  So replacing these tags with
      might not affect ranking.

      A Hybrid solution would be to use some of the HTML tags in conjunction with these css classes.  For example:


      which would override default H1 value and implement properties defined within these classes.

      CONCLUSION:

      As I mentioned earlier, this was an experiment and later thought as a concept.  You should use CSS as much as possible.  However header tags H1,H2 and H3 should still remain in your code.  In my opinion every other tags can be replaced without any problem.  If you have any comment, suggestion or idea please don't hesitate to throw a comment bellow. 


      Tagged: css   web design   htm   Parma Link | Comment(s)

      5-ways to prevent comment spamming

      posted on: August 12, 2007 at 01:27 am

      Spamming? What Spamming??
      These days, whether you are blogging or running a business website, form submission spamming has become on of the primary issue of concern and frustration. Form submission spamming usually happens if you have commenting feature on your website. Spammers like to use this opportunity to promote their website and most importantly hoping to get higher rank in search engines. Im sure most of web developers/webmasters has gone through nightmare(s) when you found dozens of v1agra (you know what i mean) related links floating around your website posts.

      Form submission some times occurs on your membership registration form as well, people attempting to create multiple accounts instantly. And if you have content submission features, such as Digg, Reddit or other social network relying on user submitted contents, then you have another form submissions to worry about.

      Prevention is better then cure.
      In deed it is. There are many ways you can prevent most of these spammers. It is hard to stop hackers entirely, but these methods should make attackers life bit difficult and have them find another nest to play around with.

      I have prepared to write about 3 ways (out of many) you can prevent form submission spam. You can implement them individually or combine them with any combination you want to add even greater security based on your need. These 3 methods are:
      1. Post Hash Authentication
      2. Hidden Text field Mechanism
      3. CAPTCHA

      [Please note, all these are programming language independent concepts, but I will be using php to demonstrate some code when necessary.]

      POST HASH AUTHENTICATION:
      This method relies on renewed hash code for authentication. So every time your page is loaded, a unique hash code is created by your server and put it on session value, which then need to be passed by form on every submission. Therefore, upon form submission the server can verify the passed hash code with session hash code for validity. And the trick is that, after validating, server has to destroy the hash right away and start looking for another one, a different one. This is very easy to implement.

      //check if form submission occurred
      if((count($_POST)) {
      if(!isset($_POST['posthash'] && ($_SESSION['posthash'] != $_POST['posthash'])) {
      die('unauthorized request.');
      } else {
      $_SESSION['posthash'] = ""; // removing current code
      }
      }

      // right after check we want to regenerate post hash, regardless if form was submitted or not
      // actual hash value can be simply md5(current time in nano second)
      define("POSTHASH", md5(time())); // making it constant for global access across your web application.
      $_SESSION['POSTHASH'];

      These codes should be on the top of each page (save it in separate file and include in every page).
      In your HTML form, you need to add special hidden field and supply this code

      <form ...>
      ...
      <input type='hidden' name='posthash' value='<?php echo POSTHASH ?>' />
      </form>

      This method will also prevent users from spamming by refreshing browser for multiple submission, since POST variable will hold previous hash and therefore will be rejected.

      Hidden Text field Mechanism:
      This method is based on a blog that I came up across. Concept is very cheap, but extremely powerful to fool most of spam bots (no bender, it's not fambot).
      This is how it works. You simply add a text field in your form and hide it's "visibility" from the users. The idea is that users will not see the text field there for it will stay blank. But, most of the spamming bots attempts to fill all the text fields they find in the form before submitting. So a simple conditional check, whether or not hidden text field has value or not, can give you clue if this is a spamming or not.

      <form ...>
      ...
      <div class='special-field'><label>Enter your Middle name:</label> <input type='text' name='middlename' value='' /></div>
      ...
      </form>

      In your CSS code, you need to set 'special-field' display to 'none'. This way users will not see the label and text field, but still will be visible in the HTML code which is used by spammers.

      In your server script, all you have to do is check if 'middlename' field has value or not:

      if(!empty($_POST['middlename'])) {
      die('unauthorized request');
      }


      CAPTCHA:
      This method is used most widely and most effective way of preventing users from spamming. CAPTCHA is almost like POST HASH concept, only addition is that instead of putting the hash value (or the captcha code) in hidden field automatically, a human user needs to read it of distorted image and enter it him/herself. Therefore this gives you highest level of prevention from Spamming.
      There are many free and effective CAPTCHA codes and class files with tutorials floating around the web, so I will not go in detail here.

      Lots of developers does not like to include CAPTCHA mechanism because it puts little bit burden on genuine users and can discourage them from posting comment or even registering.

      Conclusion:
      There are many ways one can attempt to prevent from form submission. These three I found to be useful. However, as I mentioned earlier, ti is not possible to entirely block hackers from doing what they do best. You constantly have to modify your code, provide additional security as your site gets more and more popular.

      Please share your tips and tricks, comments, suggestions.
      [PS, I am only using Hidden Text field mechanism on this site, I hope some one can start spamming me so I can push laziness out and implement other once :)]
      Tagged: html   Parma Link | Comment(s)

copyright© 2008 alaminahmed.com || powered by me!