You, sir, won the most exhaustive answer I've gotten from a stranger. Thanks a lot for taking the time to write it all down!
It was yes overwhelming as I'm not into electronics at all. I'm a web programmer so...!
So I would need a Master Brick (https://www.tinkerforge.com/en/shop/bricks/master-brick.html) and a Wifi Master extension (https://www.tinkerforge.com/en/shop/master-extensions/wifi-master-extension.html), IO-4 Bricklet (https://www.tinkerforge.com/en/shop/bricklets/io4-bricklet.html) and a Distance IR Bricklet (https://www.tinkerforge.com/en/shop/bricklets/distance-ir-bricklet.html). Do I need both Bricklets or does the Distance IR Bricklet connect directly to the Master Brick?
I'll add a Step-Down Power Supply (https://www.tinkerforge.com/en/shop/power-supplies/step-down-power-supply.html) to power it all. I just thought about the time it'll last though...
If you say this setup would consume around 100 mAh, if I use a Energizer Rechargeable 9V battery (http://www.energizer.com/batteries/rechargeable-batteries/Pages/9v.aspx) that has 175 mAh, the setup would last not even 2 hours on a single battery? I have a hard time believing this setup would use 100 mAh when my iPhone in standby mode consume about 5 mAh...!
Could I just use a 7000 mAh battery (like this one http://www.androidpolice.com/2013/04/12/deal-alert-this-7000mah-galaxy-s-iii-battery-will-power-your-phone-till-the-cows-come-home-and-its-only-34/) and think a 100 mAh setup would last 70 hours (or around 3 days).
I know I'm sidetracking the question but... anyway...
Finally, about the communication part, when you say the website can periodically query the status of the microswitch, do you mean I could do something like "masterbrick.getStatus();" in PHP and it'll return the switch status? How would I connect to the Brick via PHP?
Again, thanks for your time, I really appreciate it!