I've been there. Check to see if your iphone gets the right ip address. It's usually 192.168.1.xx or 0.xx
I often get 169.xx.xx.xx what, in the iphone wifi to ignore the current connection
Then restart the router, and then reconnect, basically can succeed.