Email

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
minds_gifts
Forum Commoner
Posts: 63
Joined: Mon Feb 10, 2003 4:23 am

Email

Post by minds_gifts »

I'm doing some e-mail activation by providing in a link in the user email which he has submitted in the contact and it works fine.

Code: Select all

$statement="UPDATE $mytable SET activated='1' WHERE activated='$rstr'"; 
echo '<hr />'; 
$statement="UPDATE $mytable SET activated='1' WHERE activated='".$HTTP_GET_VARS['id']."'"; 
echo "Your e-mail has been activated.You will receive the profile details soon."; 
$sql=mysql_query($statement) or die(mysql_error());
$rstr is the random string which is generated.
My question is:"Once the user activates his email by clicking on the link, he gets the message which is inside the echo statement.
Now the link which the user gets in the email looks like: "
http://www.blahblah.com/project/activat ... =afefdcddf
I closed the browser and opened a new one and typed exactly without the id=cddaaaeba and with a different string.In both the cases i got the message which is inside the echo statement.Though the table does'nt get updated, but still i dont want to see such a message.
How best can I do this one?
Thanks
corlando
Forum Newbie
Posts: 21
Joined: Sun Jun 15, 2003 10:07 pm

Post by corlando »

read up here

http://us3.php.net/manual/en/function.m ... d-rows.php

and use an if statement... ok no more hints you can do it!
Post Reply