Simplest way would be to have a column called (for example)
confirmed on
your user table in your database that is set by default to
"N".
When your new user registers send an email to them as you
say, which has a
link to your confirmation page (for example) confirmreg.php
and within the
url querystring you send to your user have a couple of unique
IDs (for
example) the record ID of the user account and their email
address.
When they click on the link and go to confirmreg.php you can
update the
confirmed column to Y using the Unique IDs mentioned earlier
in your SQL
WHERE clause.
After that when your user logs in you can check that the
confirmed column is
set to "Y".
An example of the URL would be
http://www.yourdomain.com/confirmreg.php?ID=9999&EMAIL=username@domain.com
HTH
Bren