meenakshidhar
Programmer
hello friends,
i want to call a new page without using submit button...i m sending u my code....in this code when user successfully login, a new page should be displayed...
<HTML><HEAD><TITLE>Untitled Document</TITLE>
</HEAD>
<BODY class=background bgColor=#ffffff>
<form method=post action="login1.php">
<TABLE height=164 width="41%" align=center border=1>
<TR borderColor=#ccffff>
<TD class=tableheading height=27>Login</TD></TR>
<TR vAlign=top borderColor=#ccffff>
<TD class=tabledata height=163>
<P>
<BR> UserName:
<INPUT type=text name=username> </P>
<P> Password:
<INPUT type=text name=password> </P>
<P>
<INPUT type=submit value=Login name=submit> <INPUT type=reset value=Clear> </P></TD></TR></TBODY></TABLE>
<P> </P>
</form>
</BODY>
</HTML>
<?php
$connection=mysql_connect("localhost","vivek","tarun150" )
or die ( "Unable to connect to server." );
$db_name="vivek";
$table_name="authentication";
$db=mysql_select_db($db_name,$connection)
or die ( "Unable to select database." );
$sql="SELECT * FROM $table_name WHERE
username ='$username' AND
password = '$password'";
$result =mysql_query($sql)
or die("Unable to execute query."
$num = mysql_num_rows($result);
if ( $num != 0 )
{
header("location:
}
else{
echo "sorry";
exit;
}
?>
here header function is used to display form...the problem is in this line only...plsss help...
i want to call a new page without using submit button...i m sending u my code....in this code when user successfully login, a new page should be displayed...
<HTML><HEAD><TITLE>Untitled Document</TITLE>
</HEAD>
<BODY class=background bgColor=#ffffff>
<form method=post action="login1.php">
<TABLE height=164 width="41%" align=center border=1>
<TR borderColor=#ccffff>
<TD class=tableheading height=27>Login</TD></TR>
<TR vAlign=top borderColor=#ccffff>
<TD class=tabledata height=163>
<P>
<BR> UserName:
<INPUT type=text name=username> </P>
<P> Password:
<INPUT type=text name=password> </P>
<P>
<INPUT type=submit value=Login name=submit> <INPUT type=reset value=Clear> </P></TD></TR></TBODY></TABLE>
<P> </P>
</form>
</BODY>
</HTML>
<?php
$connection=mysql_connect("localhost","vivek","tarun150" )
or die ( "Unable to connect to server." );
$db_name="vivek";
$table_name="authentication";
$db=mysql_select_db($db_name,$connection)
or die ( "Unable to select database." );
$sql="SELECT * FROM $table_name WHERE
username ='$username' AND
password = '$password'";
$result =mysql_query($sql)
or die("Unable to execute query."
$num = mysql_num_rows($result);
if ( $num != 0 )
{
header("location:
}
else{
echo "sorry";
exit;
}
?>
here header function is used to display form...the problem is in this line only...plsss help...