2004 hyundai accent starting problems

i have a strange intermitant starting problem. about every three weeks my car will turn over but not even want to start. it could be after a 10 minute or 5 hour drive.the car could only be sitting for 5 minutes or after 8 hours. it is not consistent. i hooked up a spare plug but it doesn’t look like it is getting spark. sometimes i will rock it in gear and it will fire up like it never had a problem. then if that doesn’t work i will have someone push me to try and compression start it. it has never fired up that way but after comming to a stop,i turn the key and it fires right up. once i tried to start it (without pushing it),then gave up and tried again 10 minutes later and again it fired right up. the only error codes i get are for the evap system(for smog) which have been on for 6 years i am stumped

It sounds like the switch that prevents the car from starting in any gear besides park or neutral might be going bad.

would that be the same in a manual one? i forgot to mention that

I’m not sure how it works with a manual transmission, but I’m sure there are others here that are more knowledgeable than me on the subject.

The problem might be with the engine control relay.

This relay sends power to the computer so it’s able to operate the ignition and fuel injection systems.

Tester

I just reread the original post and now I’m doubting my diagnosis. I figured that because it seems to get better when the gearshift is moved around, it might be the park/neutral safety switch, but if that were the case, I don’t think the key would even turn.

Key will turn with a faulty neutral safety switch you just don’t get any power to the starter.

Mike