// Passkey that got from link
//echo $passkey;

// Retrieve data from table where row that match this passkey
$sql1="SELECT * FROM $tbl_name1 WHERE confirmation_code ='$passkey'";

// If successfully queried

// Count how many row has this passkey

// if found this passkey in our database, retrieve data from table "temp_members_db"



// Insert data that retrieves from "temp_members_db" into table "registered_members"
$sql2="INSERT INTO $tbl_name2(emailad, password)VALUES('$email', '$password')";

// 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"
$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'";

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">
<style type="text/css">
<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" />

<div id="container">
        <div id="banner">


        <div id="menubar">


        <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 id="confirmdetails" >
                    <?php echo $msg;?>

        <div id="footer">
            <a href="#">RTU-MSIT ALL RIGHTS RESERVED</a>



Recommended Answers

All 2 Replies

Either you have spaces or output in one of your included files, or one or more of your files use a Byte Order Mark.


Try with adding this line after the session_start

ob_start(); // line for preventing header has already been sent error...
and this line in your footer

ob_end_flush(); // line for preventing header has already been sent error...keep this line last
before the </body> tag

Hopefully this should do the trick

By the way, if you make a search before you post the question, you would have solved your problem already. I yesterday answer the very same question:



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.