DivyaPandia Posted February 28, 2014 Share Posted February 28, 2014 <?php include("connection.php"): session_start(); if(isset($_POST['submit'])) { $uid=mysql_real_escape_string($_POST['userid']); $logpass=mysql_real_escape_string($_POST['password']); //$log=$uid; $row=mysql_query("select * from Hr where username='".$uid."' and password='".$logpass."'"); $obj=mysql_fetch_object($row); if(($logpass==$obj->password)&&($logpass!="")&&($uid==$obj->username)) { $_SESSION["hrid"]=$_POST['userid']; if(isset($_POST['keeplogin'])) { setcookie("hrcookid","$uid",time() + 60); setcookie("hrcookpass","$logpass",time() + 60); } else { setcookie("hrcookid","$uid",time() - 60); setcookie("hrcookpass","$logpass",time() - 60); } } else { $error="Invalid"; $log=$_POST['userid']; $pass=$_POST['password']; } } if(isset($_COOKIE['hrcookid'])) { $log= echo $_COOKIE['hrcookid']; $pass= echo $_COOKIE['hrcookpass']; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Prime Academy</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="wrapper"> <div class="login-plate"> <h2>Hr login</h2> <form name="login" id="hrlogin" method="post"> <input type="text" name="userid" id="userid" value="<?php echo ((isset($_POST['userid'])|| isset($_COOKIE['hrcookid']))? $log : '')?>" onblur="if(this.value == '') { this.value='User Name'}" onfocus="if (this.value == 'User Name') {this.value=''}"> <input type="password" name="password" value="<?php echo ((isset($_POST['password'])|| isset( $_COOKIE['hrcookpass']))? $pass : '')?>" onblur="if(this.value == '') { this.value='password0000'}" onfocus="if (this.value == 'password0000') {this.value=''}"><br /> <input name="submit" type="submit" value="Login" /> <div class="rememberme"><input name="keeplogin" <?php echo (isset($_COOKIE['hrcookpass'])? 'checked':'')?> value="" />Remember me</div> </form> </div> <div class="clear-fx"></div> </div> </body> </html> Ther are some errors here.Can anyone tell me what is it???? login.html Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted February 28, 2014 Share Posted February 28, 2014 Ther are some errors here. Can anyone tell me what is it???? Please dont just dump code here and expect someone to fix it. You should at least explain what it is you're trying to do. Explain what the code should be doing, and post any error(s) your code is producing. Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted February 28, 2014 Share Posted February 28, 2014 When I dump the code into Dreamweaver, it doesn't like the following lines: include("connection.php"): $log= echo $_COOKIE['hrcookid']; $pass= echo $_COOKIE['hrcookpass']; You're using a colon in the first line instead of a semi-colon. The other lines have an "echo" after the assignment operator. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.