What version of PHP are you using? ereg() has been deprecated as of 5.3.0 in favour of preg_match().
Also your regular expressions aren't thorough. What you're currently testing is if what's entered contains 3 (or 4) consecutive numbers, but if I enter in 1234 for a Mastercard CVV, it would validate. Instead test of the whole string matches the pattern, rather than a portion of it.
if(preg_match('/^[0-9]{4}$/', $cvv))//use {3} for non-AMEX cards
{
//stuff if correct
}
else
{
//stuff if incorrect
}
And Weedpacket beat me. 🙁
EDIT: Doh! No post merging. Sorry. 🙁
MOD EDIT: Sure there is! :p Posts merged.