I am a newbie to PHP, and newer still to MySQL.
I have nearly finished writing (offline for use online) a PHP script that
deals with people adding and deleting themselves off a mailing list (using
GET), all data being stored in MySQL database.
When a person signs on via a web-page, they get emailed a link to
unsubscribe from a database - with a unique ID that was generated for that
person only when they signed on (this is saved in a database). So in
any subsequent emails, the user can click the link and delete themselves
off the mailing list (running another PHP code). If the person has tried a
delete and are not listed in the database - the delete request will be
refused.
1) Is there any problems I should consider security wise?
2) How long should the unique ID be? I have currently written code to be
approx 5.6x10^11 odds of getting that same combination. Although it will
be a very small mailing list.
3) If I use the random number generation in PHP, should I use something
like "bit stuffing" to add zeros to a number. For example, If the number
generated is max 9999 - and the php random number is 34, should I
deliberately add zeros to make the number 0034? Any use to doing this?
Dariusz
I have nearly finished writing (offline for use online) a PHP script that
deals with people adding and deleting themselves off a mailing list (using
GET), all data being stored in MySQL database.
When a person signs on via a web-page, they get emailed a link to
unsubscribe from a database - with a unique ID that was generated for that
person only when they signed on (this is saved in a database). So in
any subsequent emails, the user can click the link and delete themselves
off the mailing list (running another PHP code). If the person has tried a
delete and are not listed in the database - the delete request will be
refused.
1) Is there any problems I should consider security wise?
2) How long should the unique ID be? I have currently written code to be
approx 5.6x10^11 odds of getting that same combination. Although it will
be a very small mailing list.
3) If I use the random number generation in PHP, should I use something
like "bit stuffing" to add zeros to a number. For example, If the number
generated is max 9999 - and the php random number is 34, should I
deliberately add zeros to make the number 0034? Any use to doing this?
Dariusz
Comment