Jump to content

[SOLVED] activation class


corillo181

Recommended Posts

hey i got a code that activate the user profile, but the update is not working is supposed to set the activated from 'n' to 'y'

any one knows what?

<?php
class userActivation{
var $code;
var $id;
var $db;
var $message;

function userActivation($code,$id){
	$this->code = $code;
	$this->id = $id;
	$this->db = new DB();
}

function activate(){
	$query = "SELECT user_id FROM users WHERE user_id='{$this->id}'";
	$result = $this->db->query($query);
	$getid = $this->db->fetch_array($result);
		if($getid['user_id']==$this->id){
			$query = "SELECT code FROM users WHERE code='{$this->code}'";
			$result = $this->db->query($query);
			$getCode = $this->db->fetch_array($result);
				if($getCode['code']==$this->code){
//UPDATE IS NOT WORKING
					$query = "UPDATE users SET activated='y' WHERE code='{$this->code}'";
					$result = $this->db->query($query);
					$this->message = 'your user name has been activated enjoy uploading pictures.';
					}else{
						$this->message = "Your record was not found please contact the administrator about this problem";
					} }else{
						$this->message = "Your record was not found please contact the administrator about this problem";						
					}

}
}

?>

 

Link to comment
https://forums.phpfreaks.com/topic/70252-solved-activation-class/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.