hi sir..
I write a login program in php....session function where i write in that program and session stop....
that phph program is successsfull execute....that codings are...in loginslide.html program
<html>
<head>
<title>login</title>
<body>
<form method="post" action="loginsl ide.php">
<center>
<table border="0" bgcolor="#CCCCF F" cellspacing="1" cellpadding="3" width="287">
<tr>
<td align="left" colspan="2" width="275"><b> <font size="5" color="#000080" >Login</font></b></td>
</tr>
<tr>
<td align="right" width="81"><b>< font color="#000080" >User
Name:</font></b></td>
<td width="184">
<input type="text" input name="user">
</td>
</tr>
<tr>
<td align="right" width="81"><b>< font color="#000080" >Password:</font></b></td>
<td width="184">
<input type="password" input name="pass">
</td>
</tr>
<tr>
<td colspan="2" align="center" width="275"><in put type="submit" input value="Login"></td>
</tr>
</table>
</center>
</form>
</body>
</html>
login slide.html program codings are...,,
<?php
$user=$_POST['user'];
$pass=$_POST['pass'];
$conn = mysql_connect(" localhost","roo t","") or die("could not connect server");
$db = mysql_select_db ("thiru",$co nn) or die("could not connect database");
$query= "select * from reg";
$res = mysql_query($qu ery) or die("query failed" . mysql_error());
$num_rows=mysql _num_rows($res) ;
//echo $num_rows;
while($rr=mysql _fetch_array($r es))
{
if(ereg($user,$ rr[2]))
{
if(ereg($pass,$ rr[3]))
{
$flag=true;
}
}
}
if($flag==true)
{
echo"u r in new page";
}
else
{
echo"userid and password mismatch";
}
mysql_close($co nn);
?>
please where i use session function in that program...
I write a login program in php....session function where i write in that program and session stop....
that phph program is successsfull execute....that codings are...in loginslide.html program
<html>
<head>
<title>login</title>
<body>
<form method="post" action="loginsl ide.php">
<center>
<table border="0" bgcolor="#CCCCF F" cellspacing="1" cellpadding="3" width="287">
<tr>
<td align="left" colspan="2" width="275"><b> <font size="5" color="#000080" >Login</font></b></td>
</tr>
<tr>
<td align="right" width="81"><b>< font color="#000080" >User
Name:</font></b></td>
<td width="184">
<input type="text" input name="user">
</td>
</tr>
<tr>
<td align="right" width="81"><b>< font color="#000080" >Password:</font></b></td>
<td width="184">
<input type="password" input name="pass">
</td>
</tr>
<tr>
<td colspan="2" align="center" width="275"><in put type="submit" input value="Login"></td>
</tr>
</table>
</center>
</form>
</body>
</html>
login slide.html program codings are...,,
<?php
$user=$_POST['user'];
$pass=$_POST['pass'];
$conn = mysql_connect(" localhost","roo t","") or die("could not connect server");
$db = mysql_select_db ("thiru",$co nn) or die("could not connect database");
$query= "select * from reg";
$res = mysql_query($qu ery) or die("query failed" . mysql_error());
$num_rows=mysql _num_rows($res) ;
//echo $num_rows;
while($rr=mysql _fetch_array($r es))
{
if(ereg($user,$ rr[2]))
{
if(ereg($pass,$ rr[3]))
{
$flag=true;
}
}
}
if($flag==true)
{
echo"u r in new page";
}
else
{
echo"userid and password mismatch";
}
mysql_close($co nn);
?>
please where i use session function in that program...
Comment