E-Mail Varification
Moderator: General Moderators
save it to a database, check the urls as they come to the page, if the url is the same as one that's in the database, remove the record. then, if they come back with the same url, tell them to go away.
of course you'd have to generate some sort of random character string, but there are functions to do that for ya
of course you'd have to generate some sort of random character string, but there are functions to do that for ya
ok heres what im going to do,
when they sign up have in the database:
username,email,password,
then invisible to the user there will be reg,verify
then they get emailed there "verify" number which is randomized and sent to the database and to the via email and on the opage is a bow wich they put the varify number in, once its entered the php / sql looks up that number and when they hit ok it changes reg from'0' to '1' os they are registered.
will this work?
when they sign up have in the database:
username,email,password,
then invisible to the user there will be reg,verify
then they get emailed there "verify" number which is randomized and sent to the database and to the via email and on the opage is a bow wich they put the varify number in, once its entered the php / sql looks up that number and when they hit ok it changes reg from'0' to '1' os they are registered.
will this work?
i would NOT do it like that, gives the user more to do than necessary (trust me, these web surfers are lazy sod).
Do it like this
User signs up giving email, username and password
Insert this in DB along with a random code
Send the user an email with a link something like http://www.yoursite.com/verify.php?emai ... j23hk23k34
Now, when the user clicks that link, verify.php takes the email, user and code from the url and tests them against the DB.
If there is a row in the DB that contains all three pieces of information, user is verified, otherwise decline verification.
There is no need to cloak anything.
Mark
Do it like this
User signs up giving email, username and password
Insert this in DB along with a random code
Send the user an email with a link something like http://www.yoursite.com/verify.php?emai ... j23hk23k34
Now, when the user clicks that link, verify.php takes the email, user and code from the url and tests them against the DB.
If there is a row in the DB that contains all three pieces of information, user is verified, otherwise decline verification.
There is no need to cloak anything.
Mark
buti dont have a clue how to do that....
i have worked on the idea i came up with and have got this
the rest is in the register where it ads the user id etc[quote][/quote]
i have worked on the idea i came up with and have got this
Code: Select all
<?php
include("dogs.inc"); //The database connect script
?>
<html>
<head>
<title>Verifcation</title>
</head>
</body>
<?php
$sql ="SELECT id FROM user WHERE id= '".$_POST['id']."'";
$sql ="SELECT verify FROM user WHERE verify='".$_POST['verify']."'";
if ($_POST['verify'] = 1)
{
$insert = "INSERT INTO users(
verify,)VALUES(0)"
or die("You are already verified");
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table align="center" border="1" cellspacing="0" cellpadding="3">
<tr><td>Verify:</td><td>
<input type="text" name="<?php echo @$id ?>" maxlength="40">
</td></tr>
<tr><td colspan="2" align="right">
<input type="submit" name="submit" value="Verify">
</td></tr>
</table>
</form>
Last edited by Wee-Man on Thu Mar 04, 2004 4:11 am, edited 1 time in total.
just give it a try and see what you come up with, you can only do it wrong, and when you do, come back here and we will help (again)
one not, combine your queries
Instead of...
do this
The way you are going to be doing it, by the user clicking a link, you will actually need to use $_GET instead of $_POST.
Mark
one not, combine your queries
Instead of...
Code: Select all
$sql ="SELECT id FROM user WHERE id= '".$_POST['id']."'";
$sql ="SELECT verify FROM user WHERE verify='".$_POST['verify']."'";Code: Select all
$sql ="SELECT id, verify FROM user WHERE id= '".$_POST['id']."' AND verify='".$_POST['verify']."'";Mark