<?php
include('config.php');
include('functions.php');
sqlconnect();
// Passkey that got from link
$passkey=$_GET['passkey'];
//echo $passkey;
$tbl_name1="tbltemp_subscriber";
// Retrieve data from table where row that match this passkey
$sql1="SELECT * FROM $tbl_name1 WHERE confirmation_code ='$passkey'";
$result1=mysql_query($sql1);
// If successfully queried
if($result1){
// Count how many row has this passkey
$count=mysql_num_rows($result1);
// if found this passkey in our database, retrieve data from table "temp_members_db"
if($count==1){
$rows=mysql_fetch_array($result1);
//$name=$rows['name'];
$email=$rows['email'];
$password=$rows['password'];
//$country=$rows['country'];
$tbl_name2="tblsubscriber";
// Insert data that retrieves from "temp_members_db" into table "registered_members"
$sql2="INSERT INTO $tbl_name2(emailad, password)VALUES('$email', '$password')";
$result2=mysql_query($sql2);
}
// if not found passkey, display message "Wrong Confirmation code"
else {
$msg= "Wrong Confirmation Code.";
}
// if successfully moved data from table"temp_members_db" to table "registered_members" displays message "Your account has been activated" and don't forget to delete confirmation code from table "temp_members_db"
if($result2){
$msg= "Your account has been activated, Please Click Below. <br><div id='link'><a href='home.php'>Welcome to Pasig Portal</a></div>";
// Delete information of this user from table "temp_members_db" that has this passkey
$sql3="DELETE FROM $tbl_name1 WHERE confirmation_code = '$passkey'";
$result3=mysql_query($sql3);
}
else{
header("Location: home.php");
//$msg = "You Already Confirmed Your Account. ";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
a{color:white;}
</style>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Pasig City Portal</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
<div id="banner">
</div>
<div id="menubar">
</div>
<div id="wrapper" style="background-image: url('../images/bakverify_03.gif')">
<br />
<br />
<div id="confirm">
<div id="sobre" >
<img src="../images/sobre.gif" />
</div>
<div id="confirmdetails" >
<?php echo $msg;?>
</div>
</div>
</div>
<div id="footer">
<a href="#">RTU-MSIT ALL RIGHTS RESERVED</a>
</div>
</div>
</body>
</html>
maghuyop 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.