"I put the car in neutral and moved it front and back and it started."
I am unclear as to whether you moved the shift lever "front and back" or whether you somehow moved the car "front and back" (I assume that you meant forward and back).
In any event, if placing the shift lever in neutral helped you to start the car, that is a pretty good indication that the Neutral Safety Switch is in need of replacement. On a temporary basis, simply putting the car in neutral, rather than park, when you turn the ignition key can suffice, but I would suggest having a mechanic check the Neutral Safety Switch, and replace it if it is defective.
Other possibilities include a worn-out ignition switch, and/or loose/corroded battery terminals.