Settings>General>Reset>Reset Network Settings
Then restart your iphone.
Enter your wifi password to access your network
You could need to install a fresh copy of iOS (you also said that your wifi button is grayed out).
To do this operation, make a full backup of your device's content, then restore it to factory settings, then set it up as new.
Follow these steps:
Then restore from the previously made backup.
If nothing helps, contact your nearest Apple Store.
Question: I am having a problem with the WiFi not working. After doing all the steps of checking my connection to restarting the network it still doesn’t work. This happened right after my phone got an upgrade.