turning the ignition key but engine won't turn? on 2001 Ford Explorer

I stopped in to refule the explorer w/ the engine running mind you and when i got into the truck i turned the engine off to reset the fuel milage on the trip computer but wheni went to start the truck allt he lights were on but no crank it wouldn't start i have done everything made sure it was in park everything bu when i keept trying to start the truck every third try the door locks would lock and unlock weard....can anyone help

Asked by for the 2001 Ford Explorer
You either have a bad battery or a bad connection.