[PHP] How to confirm subscriptions by e-mail on a PHP site ?

2005-05-20 Thread Mário Gamito
Hi,

I'm making this middle-range site (i. e., not so little, bit not so big,
either), and i want users that subscribe to my site to have their
confirmation made by email.

Does anyone sugests a simple, yet effective way to do this ?

Please, don't misunderstand me.
The PHP part i know.
The sugestions i'm asking for are about the mechanism.

Thanking you in advance.

Warm Regards,
-- 
Mário Gamito
Bastard Administrator in $hell
$Users, you better make your backups
Key FingerPrint: 0xA86C640A

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How to confirm subscriptions by e-mail on a PHP site ?

2005-05-20 Thread Mário Gamito
Hi,

I'm making this middle-range site (i. e., not so little, bit not so big,
either), and i want users that subscribe to my site to have their
confirmation made by email.

Does anyone sugests a simple, yet effective way to do this ?

Please, don't misunderstand me.
The PHP part i know.
The sugestions i'm asking for are about the mechanism.

Thanking you in advance.

Warm Regards,
Mário Gamito

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to confirm subscriptions by e-mail on a PHP site ?

2005-05-20 Thread Mário Gamito
Hi George,

Thank you for your answer.

The future users of the site i'm doing can register freely.
No need for aproval.

I just want to ensure that there are no fake subscriptions or fake e-mails.

I was thinking more in something like an email sent back after the form
fill, with an URL back to the site that makes the conformation.
I'm doing some experimentations on this field.

When they fill in the form, all data goes to the DB along with a random
generated code. There's a boolean field called confirmed, that has an
obvious job, i. e., defaults to FALSE.
After that, i send them a mail with an URL ending in ?code=345njkh53h23
If they click on them and the codes match, the boolean field in the DB
switches to TRUE.

I think it's a bit complicated engine for such a simple field.

Any sugestion about easying the process ?

Warm Regards,
Mário Gamito



George Pitcher wrote:
 Mario,
 
 My site is for universities. Each university has their own administrator,
 responsible for authorising each of their own subscribers. No that is
 probably overkill. However, when a new subscriber registers (simple data
 gathering form - including preferred password), the system sends off an
 email to the appropriate administrator, who logs in, awards access level (we
 have 5 different access levels) and then an email is sent to the new user
 confirming all the details.
 
 So you could have the response to the data gathering form, record the info
 in a db and then send an email to the new user.
 
 I also have a small form on the login page that if the user enters their
 email address, and its the one they registered with, it sends their login
 details inc passwords to that email address. Saves me having to sort it out.
 
 Hope this helps.
 
 George in Oxford
 
 
-Original Message-
From: Mário Gamito [mailto:[EMAIL PROTECTED]
Sent: 20 May 2005 9:21 am
To: php-general@lists.php.net
Subject: [PHP] How to confirm subscriptions by e-mail on a PHP site ?


Hi,

I'm making this middle-range site (i. e., not so little, bit not so big,
either), and i want users that subscribe to my site to have their
confirmation made by email.

Does anyone sugests a simple, yet effective way to do this ?

Please, don't misunderstand me.
The PHP part i know.
The sugestions i'm asking for are about the mechanism.

Thanking you in advance.

Warm Regards,
--
Mário Gamito
Bastard Administrator in $hell
$Users, you better make your backups
Key FingerPrint: 0xA86C640A

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to confirm subscriptions by e-mail on a PHP site ?

2005-05-20 Thread Duncan Hill
On Friday 20 May 2005 09:21, Mário Gamito typed:
 Hi,

 I'm making this middle-range site (i. e., not so little, bit not so big,
 either), and i want users that subscribe to my site to have their
 confirmation made by email.

 Does anyone sugests a simple, yet effective way to do this ?

When the user subs, generate a token in a DB table.

Send the token to the user via email with a URL to click.  Use 
mime/alternative if you want to send html and plain text so their client can 
choose the rendering method.

If you get the click where the token matches (and perhaps first name or 
similar), they've confirmed their desire to subscribe.  Do what you need to 
do with the confirmation and remove the token from the table.  Record a 
history of IP etc to show that they DID indeed confirm their sub.  Gives you 
proof that they asked for it if they contend it's spam.

-- 
My mind not only wanders, it sometimes leaves completely.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to confirm subscriptions by e-mail on a PHP site ?

2005-05-20 Thread Rory Browne
You can either email them an URL containing an activation code, which
would have them activate in their browser.

If you don't understand the terms .forwared, or MTA, you should
probably either learn more about them or skip to the third paragraph.
If you want them to activate using their email client, the question
isn't quite(although almost) so simple. You can either use the
.forward mechanism, to parse the response mail, and deal with it
accordingly(assuming you're using a .forward capable MTA).

Alternatively you can have them reply to an account, and set up a cron
job(assuming you're on unix) to have PHP check the account using it's
imap functions every minute. The first way would be preferable.



On 5/20/05, Mário Gamito [EMAIL PROTECTED] wrote:
 Hi,
 
 I'm making this middle-range site (i. e., not so little, bit not so big,
 either), and i want users that subscribe to my site to have their
 confirmation made by email.
 
 Does anyone sugests a simple, yet effective way to do this ?
 
 Please, don't misunderstand me.
 The PHP part i know.
 The sugestions i'm asking for are about the mechanism.
 
 Thanking you in advance.
 
 Warm Regards,
 Mário Gamito
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to confirm subscriptions by e-mail on a PHP site ?

2005-05-20 Thread Jim Moseby
What I do is generate a random key, save it in the database, send them an
email with a link that they must click to validate their email:

http://www.mysite.com/[EMAIL PROTECTED][EMAIL PROTECTED]
9j(*(hn3983n*(j

Its not foolproof, I know, but it is simple and effective, as you say.

Heres a quick and dirty function to generate the key:

function KeyGen($length){  // Generates random, mixed case, alphanumeric
string of $length characters.
 
for($len=$length,$r='';strlen($r)$len;$r.=chr(!mt_rand(0,2)?mt_rand(48,57):
(!mt_rand(0,1)?mt_rand(65,90):mt_rand(97,122;
  return $r;
}

JM


 -Original Message-
 From: Mário Gamito [mailto:[EMAIL PROTECTED]
 Sent: Friday, May 20, 2005 5:13 AM
 To: php-general@lists.php.net
 Subject: [PHP] How to confirm subscriptions by e-mail on a PHP site ?
 
 
 Hi,
 
 I'm making this middle-range site (i. e., not so little, bit 
 not so big,
 either), and i want users that subscribe to my site to have their
 confirmation made by email.
 
 Does anyone sugests a simple, yet effective way to do this ?
 
 Please, don't misunderstand me.
 The PHP part i know.
 The sugestions i'm asking for are about the mechanism.
 
 Thanking you in advance.
 
 Warm Regards,
 Mário Gamito
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to confirm subscriptions by e-mail on a PHP site ?

2005-05-20 Thread Marcus Joyce
The way i did it was, put a 25char hash inside the registered column,
then sent an email to the user containing something like
domain.com?user=id_numberhash=hash
then i did select userID where userID = $_GET['user']  registered = 
$_GET['hash']

(not exactly the sql phrase, but i dont feel like adding %s's and 
mysql_real_escape_strings to it but you get the picture)

then from the data i got, i did
if($row_is_returned)
{
  update users set registered=yes WHERE userID = $_GET['user'];
}
and that was it.
Marcus
Mário Gamito wrote:
Hi,
I'm making this middle-range site (i. e., not so little, bit not so big,
either), and i want users that subscribe to my site to have their
confirmation made by email.
Does anyone sugests a simple, yet effective way to do this ?
Please, don't misunderstand me.
The PHP part i know.
The sugestions i'm asking for are about the mechanism.
Thanking you in advance.
Warm Regards,
Mário Gamito
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php