When a user enters a correct or incorrect password, a message correct or incorrect flashes up before it goes to URL's. I have tried removing echo, tried echo off etc but anything I take out does not work or cripples it going to the URL.
Thanks
<html>
<head>
<title>Form Results</title>
</head>
<body>
<?php
// This page receives and handles the data generated by "form.html".
//$array['name'] = $_POST['array']['username'] . '' . $_POST['array']['password'];
$array['name'] = $_POST['array']['username'] ;
$array2['name2'] = $_POST['array']['password'] ;
$array3['name3'] = $_POST['array']['email'] ;
//print ('User name is '. $array['name'] . "<br>\n");
//print ('Password is '. $array2['name2'] . "<br>\n");
//print ('Email is '. $array3['name3'] . "<br>\n");
$db = mysql_connect("localhost", "database", "password");
mysql_select_db("table",$db) or die("Select DB Error: ".mysql_error());
$sql = "select * from Validnames where Names = '" . $array['name'] . "'";
if ( $qry =mysql_query($sql) ) {
$numrows = mysql_num_rows($qry);
if ( $numrows > 0 ) {
printf("<tr><td>Valid Name %s</td>",$username);
$url = "Main.htm";
echo "<script>location.href='$url'</script>";
}
else {
printf("<tr><td>Not a Valid Name %s</td>",$colvalue);
//$url = "redirect_page.php";
$url = "
echo "<script>location.href='$url'</script>";
}
}
?>
</body>
</html>
Thanks
<html>
<head>
<title>Form Results</title>
</head>
<body>
<?php
// This page receives and handles the data generated by "form.html".
//$array['name'] = $_POST['array']['username'] . '' . $_POST['array']['password'];
$array['name'] = $_POST['array']['username'] ;
$array2['name2'] = $_POST['array']['password'] ;
$array3['name3'] = $_POST['array']['email'] ;
//print ('User name is '. $array['name'] . "<br>\n");
//print ('Password is '. $array2['name2'] . "<br>\n");
//print ('Email is '. $array3['name3'] . "<br>\n");
$db = mysql_connect("localhost", "database", "password");
mysql_select_db("table",$db) or die("Select DB Error: ".mysql_error());
$sql = "select * from Validnames where Names = '" . $array['name'] . "'";
if ( $qry =mysql_query($sql) ) {
$numrows = mysql_num_rows($qry);
if ( $numrows > 0 ) {
printf("<tr><td>Valid Name %s</td>",$username);
$url = "Main.htm";
echo "<script>location.href='$url'</script>";
}
else {
printf("<tr><td>Not a Valid Name %s</td>",$colvalue);
//$url = "redirect_page.php";
$url = "
echo "<script>location.href='$url'</script>";
}
}
?>
</body>
</html>