Confirmación de Registro con PHP
Hola, tengo un registro de usuarios con foro y al registrarte te pide una activación el detalle es que siempre que se registra un usuario al intentar activar me marca un error este es mi código php no se si tenga alguna falla. Agradecería mucho su ayuda para resolver este problema. Saludos
<html>
<head>
<title>Crear Usuario</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="style.css" media="screen" rel="stylesheet" type="text/css">
</head>
<!--recibimos datos y procesamos-->
<?php
error_reporting(0);
$username = $_COOKIE['loggedin'];
include "../config.php";
mysql_connect($server, $db_user, $db_pass) or die (mysql_error());
$result = mysql_db_query($database, "select * from $table WHERE username = '$username'") or die (mysql_error());
while ($qry = mysql_fetch_array($result))
if ($qry[confirmar] > 1 ) {
echo "<meta http-equiv='Refresh' content='0;url=index.php'>";
}
else {
echo "<body class='tfw es logged-out nofooter js'>
<div id='header' role='banner'>
<div class='bar'>
<h1 class='logo'><a href='http://www.websoftech.tk/' class='alternate-context'>Websoftech.tk</a></h1>
<div id='not-logged-in'> <span class='blurb'>No eres Usuario?</span> <a href='registrar.html' class='sign-up alternate-context'>Regístrate</a>
</div>
</div>
</div>
<div id='bd' role='main'>
<table width='620' border='0' cellspacing='0' cellpadding='0' align='center'>
<tbody><tr>
<td class='corner_top_left'>
</td><td class='border_top'>
</td><td class='corner_top_right'>
</td></tr>
<tr>
<td class='border_left'>
</td><td>
<table class='message_container' cellspacing='2' cellpadding='2'>
<tbody><tr>
<td class='picto_ok'>
</td><td class='message'>";
$username = $_COOKIE['loggedin'];
include "../config.php";
mysql_connect($server, $db_user, $db_pass) or die (mysql_error());
$result = mysql_db_query($database, "select * from $table WHERE username = '$username'") or die (mysql_error());
while ($qry = mysql_fetch_array($result))
{
echo "
<form name='webtaller' action='activar.php' method='post'>
<input type='text' name='username' value='$qry[username]' style='display:none;'>
<input type='text' name='confirmar' value='2' style='display:none;'>
<br>
<div class='row submit'>
Para continuar debes activar tu cuenta:<br>
<input class='submit button selected' id='activar' style='position: relative; left: 122px; top: 15px;'name='commit' type='submit' value='Activar!'>
</div>
</form>";
}
echo "</td>
</tr>
</tbody></table>
</td>
<td class='border_right'>
</td></tr>
<tr>
<td class='corner_bottom_left'>
</td><td class='border_bottom'>
</td><td class='corner_bottom_right'>
</td></tr>
</tbody></table>
</div>
</body>";
}
?>