Jump to content

need help in cookies


Deoctor

Recommended Posts

Hai

i am writing this code and the cookies which i am setting are not working in this one..

can some one tell me why is it not working

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[url=http://www.w3.org/TR/html4/strict.dtd]http://www.w3.org/TR/html4/strict.dtd[/url]">
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title> Support Ticket System</title>
    <link rel="stylesheet" href="./styles/main.css" media="screen">
    <link rel="stylesheet" href="./styles/colors.css" media="screen">
</head>
<body>
<div id="container">
    <div id="header">
        <a id="logo" href="login.php" title="Ninestars Support Center"><img src="./images/logo2.jpg" border=0 alt="Ninestars Support Center"></a>
        <p><span><b>NINESTARS</b> SUPPORT TICKET</span> SYSTEM</p>
    </div>
   
    <div id="content">
<div id="index">
<h1>Welcome to the support center</h1>
<p class="big">In order to streamline support requests and better serve you, we utilize a support ticket system. Every support request is assigned a unique ticket number which you can use to track the progress and responses online. For your reference we provide complete archives and history of all your support requests. A valid email address is required.</p>
<hr />
<br />
<div class="rcol">
  <img src="./images/ticket_status_icon.jpg" width="48" height="48" align="left" style="padding-bottom:150px;">
  <h3>Enter login details</h3>Please enter the email id and password which has been shared to you.
  <br /><br />
  <form class="status_form" action="login.php" method="post">
    <fieldset>
      <label>Email:</label>
      <input type="text" name="lemail">
    </fieldset>
    <fieldset>
     <label>Password#:</label>
     <input type="text" name="lpwd">
    </fieldset>
    <fieldset>
        <label> </label>
         <input type="submit" name="login" class="button2" value="Login">
    </fieldset>
  </form>
</div>
<div class="clear"></div>
<br />
</div>
<br />
<div style="clear:both"></div> 
</div>
<div id="footer">Copyright © <a href="[url=http://www.ninestars.in]http://www.ninestars.in[/url]">Ninestars</a>. All rights reserved</div>

</body>
</html>
<?php

if(isset($_POST['login']))
{
error_reporting(off);

    include("db/access.php");
    $uname=$_POST['lemail'];
$pwd=$_POST['lpwd'];
$query=mysql_query("select first_nm from client_details where email='$uname' and pwd='$pwd'") or die(mysql_error());
$result=mysql_result($query,0);
if($result!='')
{
echo "hai ".$uname."<br>";
setcookie("user", "chaitanya", time()+3600);
echo "Welcome " . $_COOKIE["user"] . "!<br/>";
//echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=open.php\">";

}
else
{
echo ("<table><td bgcolor=orange width=100%><font face=Verdana, Arial, Helvetica, sans-serif size=2><b><center>You have entered a wrong username or password</center></b></font></td></table>");

    //echo "<center><b>You have entered a wrong username or password</b></center>";
    //echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=login.php\">";
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/188987-need-help-in-cookies/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.