CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Activate account

Print topic Send  topic

Author Message
rayray

Posts: 2
Posted: 03/24/2004, 11:37 PM

How to write php code for the newly registered users to activate their account?

Thank you!!!
View profile  Send private message
lvalverdeb

Posts: 299
Posted: 03/31/2004, 11:38 PM

ray,

how about something like this?

1)The user clicks on a link that contains the activation code e.g. http://www.yourdomain/activate.php?userid=aaa&activationcode=xxxxxxxxxxx.
2) on the afterinitialise event of your page you could use something similar to the following:
  
global $pagename;  
$dispmessage = "Your account has not been activated";  
$userid = CCGetFromGet("userid","");  
$activcode = CCGetFromGet("activationcode","");  
if (strlen($activcode) && strlen($userid))  {  
   $db = new clsDByourconn();  
   $cSQL = "UPDATE usertable SET activationcode = ".$activcode." WHERE user_id =".$userid;  
   $db->query($cSQL);  
   $db->close;  
    $dispmessage ="Your account has been activated";  
}  
$pagename->lblMessage->SetValue($dispmessage);  

Luis
_________________
lvalverdeb
CR, GMT-6
XAMPP/Ubuntu/CCS3.2/4
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.