Narated By As-Sab bin Jaththama : The Prophet passed by me at a place called Al-Abwa or Waddan, and was asked whether it was permissible to attack the pagan warriors at night with the probability of exposing their women and children to danger. The Prophet replied, "They (i.e. women and children) are from them (i.e. pagans)." I also heard the Prophet saying, "The institution of Hima is invalid except for Allah and His Apostle." [V004, B052, Hadith Number 256]
That is the hadith you just quoted, and it says plainly that you can kill innocents in this hadith. You can call it an "accident" all you like, but from what I gather, your first language is English, so you know that it truthfully could not be considered "accidental" by any stretch of the imagination.
It is not an accident when you go into a dark town and start swinging your sword wildly and happen to kill children. In English, this would never fit the definition of "accident", but would in fact meet the defiintion of "negligence".
Furthermore, when they used catapults in the siege of Ta'If, you call any of those death fo children "accidental". That doesn't pass the most rudimentary test of logic. When one chooses to use a catapult on a city, the deaths incurred are not "accidental". According to Islam, with the exception of the Maliki school, all you have to do to justify this action is state that your intended target was the infidel.
How is what Hamas does any different than Ta'If? There are soildiers in Israel, and Hamas sends the rockets into Israel, killing innocents. THere were soldiers in Ta'If, and Muhammad bombarded them with catapults.
Now I will ask you again, when you originally stated: "Prophet Muhammad forbade the killing of any innocent woman, child, or elderly", were you lying, or just made a mistake when typing a response quickly? Please answer my question, I don't feel like asking it over and over.