That's a good way to lose visitors permanently. It's as bad as the sites that still say, "for best results, use Internet Explorer 6 to view this site". At most, the pop-up could say "Please bear with us while we work on a way to better accommodate mobile visitors." Even then, a pop-up is likely to greatly annoy some of your visitors (they have to take action to dismiss the pop-up). Do you really need this?
I'm not sure how to determine if the user is on a mobile. Perhaps the HTTP USER_AGENT (PHP: $_SERVER['HTTP_USER_AGENT']) could be useful, although I don't know what specific values to look for. You may have to do some research on your own. Since you haven't said what kind of software you're using (as a self-described coding newbie, I would presume you're using a canned application), I can't help you beyond that. Certainly any supported canned application should have either a tech support or a community forum to ask about such things in (detecting mobile users and how to do a pop-up). You can look at the source code of something like SMF (simplemachines.org) forum to see how they try to detect various classes of mobile users and tailor the output to them.