<?php
		session_start();
		mysql_connect("localhost","root","");
		mysql_select_db("bu");
		if(isset($_REQUEST["Submit"]))
		{
			$res=mysql_query("select * from userinfo where user_email='".$_REQUEST["email"]."'");
			
			
			$num=mysql_num_rows($res);
			if($num!=0)
			{
				$row=mysql_fetch_array($res);
				$_SESSION["userid"]=$row[0];
				if($row["user_email"]==$_REQUEST["email"] && $row["user_pass"]==$_REQUEST["pass"])
				{
					?><script type="text/javascript">window.location="home/mainhomepage.php"</script><?php
				}
				else
				{
					$msg="invalid emailid or password";
				}
			}
		}


?>




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css"> 
#div
{
width:50px;
height:50px;
background:blank;
position:relative;
animation:myfirst 5s linear 2s infinite alternate;
/*Safari and Chrome: */
-webkit-animation:myfirst 5s linear 2s infinite alternate;
}
@-webkit-keyframes myfirst /*Safari and Chrome */
{
0%   {background:blank; left:0px; top:0px;}
25%  {background:blank; left:500px; top:0px;}
50%  {background:blank; left:500px; top:400px;}
75%  {background:blank; left:0px; top:400px;}
100% {background:blank; left:0px; top:0px;}
}
.style1 {color: #FF0000}
.style3 {color: #CC0000}
</style>
</head>
<body>
<table width="100%"><tr><td><?php echo include("header.php"); ?></td></tr>
  <tr>
    <td><table width="100%" border="0">
      <tr>
        <td width="45%"><h2><font color="#CC0033">C Exam, C# Exam, Java Exam, Aptitude   Exam </font></h2></td>
        <td width="55%"><table width="50%" border="0" align="center">
          <caption align="top">
            <strong><font color="#CC0000">Refrence of my Website </font>           </strong>
          </caption>
          <tr>
            <td width="14%"><marquee scrollamount="1">
            <strong><font color="#CC0099">C Exam </font></strong>
            </marquee>
            </td>
            <td width="4%">&nbsp;</td>
            <td width="14%"><marquee scrollamount="1">
            <font color="#CC0099" >  <b>C# Exam </b></font>
            </marquee></td>
            <td width="3%">&nbsp;</td>
            <td width="28%"><marquee scrollamount="1"><font color="#CC0099" >  <b>JAVASCRIPT</b></font></marquee></td>
            <td width="3%">&nbsp;</td>
            <td width="14%"><marquee scrollamount="1">
            <strong><font color="#CC0099">Aptitude Exam </font></strong>
            </marquee>
            </td>
            <td width="3%">&nbsp;</td>
            <td width="13%"><marquee scrollamount="1">
            <strong><font color="#CC0099">Reasoning Exam </font></strong>
            </marquee>
            </td>
            <td width="4%">&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<form id="form1" name="form1" method="post" action="">
<table width="100%" border="0">
  <tr>
    <td><table width="100%" border="0">
      <tr>
        <td width="55%"><img src="home/images/images.jpg" width="513" height="258"></td>
        <td width="45%"><table width="100%" border="0" background="slt/bg/background_from_myspace-815x734.jpg">
          <tr>
            <td><table width="387" border="0" cellspacing="0" cellpadding="0"  align="center">
                <tr>
                  <td width="383"><div align="center"><span class="style3">Login</span> <span class="style1">With</span> <strong>Your</strong></div></td>
                </tr>
                <tr>
                  <td><table width="379" border="0" cellspacing="0" cellpadding="5" >
                      <tr>
                        <td width="173"><div align="right">Enter emailid </div></td>
                        <td width="180"><input name="email" type="text" id="email" /></td>
                      </tr>
                      <tr>
                        <td><div align="right">Enter password </div></td>
                        <td><input name="pass" type="password" id="pass" /></td>
                      </tr>
                      <tr>
                        <td><?php if(isset($_REQUEST["Submit"])){ echo $msg; } ?></td>
                        <td><input type="submit" name="Submit" value="Submit" /></td>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td><table width="84%" border="0">
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td height="83"><table width="100%" border="0">
                      <tr>
                        <td width="47%">&nbsp;</td>
                      </tr>
                      <tr>
					  <td><div align="right">New User  </div></td>
					  
                        <td width="30%" background="help/images/bg-bubplastic-h-aqua.gif">
                                      <a href="registration.php"><font color="#FFFFFF">Create Account  &gt;&gt;</font></a> </label></td>
									  <td></td>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<p>&nbsp;</p>
</form>
<table width="100%"><tr><td><?php echo include("footer.php"); ?></td></tr></table>
</body>
</html>


