I had this issue and was causing me real headache. I initially thought it was hardware failure of my phone but later I found reason is something else.
For some reason I had changed Wireless Security of my WiFi router from WPA2 Personal to something else (I guess WEP).
That was causing my phone...