Primero te sugiero que estructures tu codigo
Aqui te paso una "limpieza" de tu codigo
Código PHP:
<html>
<head>
<style type="text/css">
body {background-color:#000000; color:#FF6600}
</style>
</head>
<body>
<?php
$name=$_POST['name'];
$password=$_POST['password'];
if (!isset($_POST['name']) && !isset ($_POST['password']))
{
?>
<h2> Esta página es secreta </h2>
<form method="post" action="secretdb.php">
Username:<br>
<input type="text" name="name">
<br>
Password: <br>
<input type="password" name="password">
<br>
<input type="submit" value="Enviar informacion">
</form>
<?php
}
else
{
$mysql=mysql_connect("localhost","USUARIODB","PASS WORDDB");
mysql_select_db("BASE_DE_DATOS",$mysql);
if(mysql_error($mysql))
{
echo "error base de datos";
}
// query the database to see if there is a record which matches
$query = "select 1 from MITABLA where name='$name' and password='$password'";
$result = mysql_query($query, $mysql);
if(mysql_num_rows($result)>0)
echo "Usuario y contraseña CORRECTOS";
else
echo "Usuairo o Contraseña INCORRECTOS";
}
?>
</body>
</html>
Que dudas tienes?
el error es que los parametros estaban al revez...
sin afan de ofender, tira ese libro...