Jump to content

My Login Script


topflight

Recommended Posts

I Have A login Script that works just fine. However my Login Script is on the side of my website so when you login the login box expands and you will get the special user options. Well the problem I am having is that if you login on any page the (index,contactus,historty etc....) you can login successfully however when you go to another page the login box turns into the login form with the basic ID and Password form. I want to be like if you are loged in no matter what page you go to the login box will still show the login options. Currently in my situation it doesn't you have to keep logging in. I am using sessions and the sessions are registering because I have certain pages that only user can see with registered sessions. The following is my code

<?php


if(isset($_POST['user']))
{
//Include Config File For DB info..
include 'db.php';
//Connect TO The MySQL Server
$connect = mysql_connect($db_host,$db_username,$db_password)
  or die("MySQL Said:".mysql_error());
  
$database = mysql_select_db($db_database,$connect)
  or die("MySQl Said:".mysql_error());
  
$login = mysql_real_escape_string($_POST['user']);
$pwd = mysql_real_escape_string($_POST['pwd']);

$link = mysql_query("SELECT * FROM `pilots` where login='$login' and pwd='$pwd'")
  or die("MySQL Said:".mysql_error());
  
$count = mysql_num_rows($link);
$data = mysql_fetch_assoc($link);
$lname = $data["lname"];
$hub = $data["hub"];
$pwd = $data["pwd"];
$fname = $data["fname"];


if($count == 1)
{




  if($data['status'] == 0)
   {
    echo '<center>Your Account Is Not Active.</center>';
   }
  else
  {
   if($data['status'] == 2)
    {
    echo '<center><FONT COLOR =ff001b>Your Account Has Been Suspended.</center></FONT COLOR>';?>
    <center><a href="logout.php">Log Out</a></br></center>
   
<?php  }
   else
   {
     if($data['status'] == 3)
    {
    echo '<center>You Are Currently On L.O.A</center>';?>
     <a href="rfileloa.php?login=<? echo "{$data["login"]}"?>">Return From L.O.A</a></br><?php
   }
   else
   {
    
    
     setcookie("login",$login);
     setcookie("lname",$lname);
     setcookie("hub",$hub);
     setcookie("pwd",$pwd);
     setcookie("fname",$fname);?>
   <body link="#0066FF" vlink="#0066FF" alink="#0066FF">
   <center>
   <h7><i><b>Pilots Panel</b></i></h7></br>
   <a href="filepirep.php?lname=<? echo "{$data["lname"]}"?>">File Pirep</a></br>
   <a href="fileloa.php?login=<? echo "{$data["login"]}"?>">File LOA</a></br>
   <a href="sigs.php">Signatures</a></br>
   <A HREF="profile.php?login=<? echo "{$data["login"]}"?> ">My Profile</a></br>
   <a href="editp.php?login=<? echo "{$data["login"]}"?>">Edit My Profile</a></br>
   <a href="#">Events</a></br>
   <a href="roster.php">VIew Roster</a></br>
   <a href="#"><font color="#FF0000">Resignation Form</font Color></br>
   <a href="logout.php">Log Out</a></br>
   
   <br>
   <h7><i><b>Pilots Tools</b></i></h7></br>
   <a href="http://www.fspassengers.com/"> FS Passengers</a></br>
   </center>

    <?php
   if($data['hm'] == 1)
    {?>
     <center>
    <h7><i><b>Hub Manager Panel</b></i></h7></br>
     <a href="edithub.php?hub=<?php echo $data['hub']; ?>">Edit Hub Page</a></br>
     <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br>
     <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br>
     <a href="awards.php">Grant Award</a></br>
    </center>
    <?php
   }
   if($data['fm'] == 1)
    {?>
     <center>
    <h7><i><b>Fleet Manager Panel</b></i></h7></br>
     <a href="addaircraft.php">Add Aircraft</a></br>
     <a href="manageaircraft.php">Manage Aircraft</a>
     </center>
    <?php
   }
   if($data['ed'] == 1)
    {?>
   <center>
    <h7><i><b>Events Director Panel</b></i></h7></br>
    <a href="addevent.php">Add Event</a></br>
    <a href="manageevents.php">Manage Events</a></br>
    <a href="postnews.php">Post News</a></br>
   
   
</center>
    <?php
   }
   if($data['hr'] == 1)
    { ?>
    <center>
    <h7><i><b>Human Rescources Panel</b></i></h7></br>
    <a href="newpilots.php">New Pilots</a></br>
    <a href="editpilots.php">Edit Pilots</a></br>
    <a href="viewcomments.php">View Comments</a></br>
    <a href="viewsitecomments.php">View Site Comments</a></br>
   <?php
   }
   if($data['bm'] == 1)
    {?>
    <center>
     <h7><i><b>Executive Staff Panel</b></i></h7></br>
     <a href="edithub.php?hub=<?php echo $data['hub']; ?>">Edit Hub Page</a></br>
     <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br>
     <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br>
     <a href="awards.php">Grant Award</a></br>
     <a href="addaircraft.php">Add Aircraft</a></br>
     <a href="addstaffmember.php">Grant Staff Acesses</a></br>
    <a href="revokestaffmember.php">Revoke Staff Acesses</a></br>
    <a href="manageaircraft.php">Manage Aircraft</a></br>
    <a href="addevents.php">Add Event</a></br>
     <a href="manageevents.php">Manage Events</a></br>
     <a href="postnews.php">Post News</a></br>
    <a href="pilotrec.php">Pilot Records</a></br>
    <a href="newpilots.php?staffid=<? echo "{$data["login"]}"?>">New Pilots</a></br>
     <a href="editpilots.php">Edit Pilots</a></br>
     <a href="viewcomments.php">View Comments</a></br>
     <a href="viewsitecomments.php">View Site Comments</a></br>
   
   <?php
   }
  }
  } }
}
else
{?>
<script>javascript:alert("Log In Failed!")</script>
<?php
  echo '<center><FONT COLOR =ff001b> Your <i>Pilot ID And/Or Password</i> is wrong!</center></FONT COLOR>';?>
<style type="text/css">
.idBox {
width:50px;
}
.passwordBox {
width:80px;
}
</style>

<table border="0" align="center">
<form action="<? $_SERVER['PHP_SELF']; ?>" method="post">
  <tr>
    <td align="center">ID:</td><td align="center">ASA<input type="text" name="user" class="idBox"></td>
  </tr>
  <tr>
    <td align="center">Password:</td><td align="center"><input type="password" name="pwd" class="passwordBox"></td>
  </tr>
  <tr>
    <td></td><td align="center"><input type="submit" name="login" value="Login"></td>
  </tr>
</table>
<?
}?>
<?php } else {?>
<style type="text/css">
.idBox {
width:50px;
}
.passwordBox {
width:80px;
}
</style>

<table border="0" align="center">
<form action="<? $_SERVER['PHP_SELF']; ?>" method="post">
  <tr>
    <td align="center">ID:</td><td align="center">ASA<input type="text" name="user" class="idBox"></td>
  </tr>
  <tr>
    <td align="center">Password:</td><td align="center"><input type="password" name="pwd" class="passwordBox"></td>
  </tr>
  <tr>
    <td></td><td align="center"><input type="submit" name="login" value="Login"></td>
  </tr>
</table>
<?php } ?>

Once again my login information is on the right side of my site and when you click login and if everything is correct the box expands and shows you the user options like it is suppose to but if you go to another page on the site the login box goes back to the login form and I want it to have it set up so that the login content will still show unless you hit logout. Help is really appreciated. 

 

 

 

Link to comment
Share on other sites

with your cookies, try adding "/" after the variable. I was having a problem with accessing cookies that I set, but when I added that I was able to access them.

 

setcookie("login",$login,"/");
setcookie("lname",$lname,"/");
setcookie("hub",$hub,"/");
setcookie("pwd",$pwd,"/");
setcookie("fname",$fname,"/");

Link to comment
Share on other sites

Not that this is what you are asking for but why do you keep opening and closing php tags?

 

Instead of:

 

<body link="#0066FF" vlink="#0066FF" alink="#0066FF">

  <center>

  <h7><i><b>Pilots Panel</b></i></h7></br>

  <a href="filepirep.php?lname=<? echo "{$data["lname"]}"?>">File Pirep</a></br>

 

you could do

 

echo '<body link="#0066FF" vlink="#0066FF" alink="#0066FF">

  <center>

  <h7><i><b>Pilots Panel</b></i></h7></br>

  <a href="filepirep.php?lname=<' . data['lname'] . '>File Pirep</a></br>'

 

Cheers

Link to comment
Share on other sites

Ok here goes - I'm not brilliant at this but:

 

<?php

// Create a login/logout link.

if ( (isset($_SEESION['login'])) $$ (!strpos($_SERVER['PHP_SELF'], 'logout.php')) ) {

  echo '<a href="logout.php title="Logout">Logout</a>';

} else {

  echo '<a href="login.php" title="login">login</a>';

}

?>

 

Hope this helps - appologies for posting before I finished. I couldn't work out how you login but I'm sure you can adapt the script.

 

Taken from PHP And MySQL for Dynamc Websites by Larry Ullman.

 

Cheers,

Colin

 

 

 

Link to comment
Share on other sites

With the way you are validating the user, you are using server resources so much

 

anyways, what you should do:

validate once in the login page and set sessions vars instead of cookies

like this way

sessions_start();

$_SESSION['login']= $login;

$_SESSION['is_logged_in'] = true;

.....etc

 

with that session variable $_SESSION['is_logged_in'] you can validate if he is logged in or not and also display the box of his control panel by using an if statement...

 

 

I also recommend you to use md5() or sha1() functions to encrypt user password, search the manual for it.

 

hope my reply was useful

Link to comment
Share on other sites

wi

With the way you are validating the user, you are using server resources so much

 

anyways, what you should do:

validate once in the login page and set sessions vars instead of cookies

like this way

sessions_start();

$_SESSION['login']= $login;

$_SESSION['is_logged_in'] = true;

.....etc

 

with that session variable $_SESSION['is_logged_in'] you can validate if he is logged in or not and also display the box of his control panel by using an if statement...

 

 

I also recommend you to use md5() or sha1() functions to encrypt user password, search the manual for it.

 

hope my reply was useful

Will I put that at the top of the login.php page or bottom? And tried something similar to that but my login script got messed up a little bit.

Link to comment
Share on other sites

This is what my login code looks like now.

<?php
session_start();
?>

<?php
if(isset($_POST['user']))
{
//Include Config File For DB info..
include 'db.php';
//Connect TO The MySQL Server
$connect = mysql_connect($db_host,$db_username,$db_password)
  or die("MySQL Said:".mysql_error());
  
$database = mysql_select_db($db_database,$connect)
  or die("MySQl Said:".mysql_error());
  
$login = mysql_real_escape_string($_POST['user']);
$pwd = mysql_real_escape_string($_POST['pwd']);

$link = mysql_query("SELECT * FROM `pilots` where login='$login' and pwd='$pwd'")
  or die("MySQL Said:".mysql_error());
  
$count = mysql_num_rows($link);
$data = mysql_fetch_assoc($link);
$lname = $data["lname"];
$hub = $data["hub"];
$pwd = $data["pwd"];
$fname = $data["fname"];
$login= $data["login"];
$status= $data["status"];

$newp = mysql_query("SELECT * FROM `pilots` where status ='0'")
  or die("MySQL Said:".mysql_error());
  
  $newprow = mysql_num_rows($newp);
  $result = count($newp);
  


if($count == 1)
{




  if($data['status'] == 0)
   {
    echo '<center>Your Account Is Not Active.</center>';
   }
  else
  {
   if($data['status'] == 2)
    {
    echo '<center><FONT COLOR =ff001b>Your Account Has Been Suspended.</center></FONT COLOR>';?>
    <center><a href="logout.php">Log Out</a></br></center>
   
<?  }
   else
   {
     if($data['status'] == 3)
    {
    echo '<center>You Are Currently On L.O.A</center>';?>
  <a href="rfileloa.php?login=<? echo "{$data["login"]}"?>">Return From L.O.A</a></br><?
   }
   else
   {



$_SESSION['SESS_LOGGEDIN'] = TRUE;
$_SESSION['SESS_LNAME'] = $lname;
$_SESSION['SESS_HUB'] = $hub;
$_SESSION['SESS_FNAME'] = $fname;
$_SESSION['login'] = $login;
$_SESSION['status'] = $status;


?>
   <body link="#0066FF" vlink="#0066FF" alink="#0066FF">
   <center>Welcome Back <? echo"$fname"; ?> <? echo"$lname"; ?></center>
   <center>
   <h7><i><b>Pilots Panel</b></i></h7></br>
   <a href="?page=pirepform&lname=<? echo "{$data["lname"]}"?>">File Pirep</a></br>
   <a href="?page=fileloa&login=<? echo "{$data["login"]}"?>">File LOA</a></br>
   <a href="#">Signatures</a></br>
   <A HREF="?page=profile&login=<? echo "{$data["login"]}"?> ">My Profile</a></br>
   <a href="?page=editp&login=<? echo "{$data["login"]}"?>">Edit My Profile</a></br>
   <a href="?page=events">Events</a></br>
   <a href="?page=rosterphp">VIew Roster</a></br>
   <a href="#"><font color="#FF0000">Resignation Form</font Color></br>
   <a href="logout.php">Log Out</a></br>
   
   <br>
   <h7><i><b>Pilots Tools</b></i></h7></br>
   <a href="http://www.fspassengers.com/"> FS Passengers</a></br>
   </center>
  
    <?php
   if($data['hm'] == 1)
    {?>
     <center>
    <h7><i><b>Hub Manager Panel</b></i></h7></br>
     <a href="edithub.php?hub=<?php echo $data['hub']; ?>">Edit Hub Page</a></br>
     <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br>
     <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br>
     <a href="awards.php">Grant Award</a></br>
    </center>
    <?php
   }
   if($data['fm'] == 1)
    {?>
     <center>
    <h7><i><b>Fleet Manager Panel</b></i></h7></br>
     <a href="addaircraft.php">Add Aircraft</a></br>
     <a href="manageaircraft.php">Manage Aircraft</a>
     </center>
    <?php
   }
   if($data['ed'] == 1)
    {?>
   <center>
    <h7><i><b>Events Director Panel</b></i></h7></br>
    <a href="?page=addevent">Add Event</a></br>
    <a href="?page=manageevents">Manage Events</a></br>
    <a href="postnews.php">Post News</a></br>


</center>
    <?php
   }
   if($data['hr'] == 1)
    { ?>
    <center>
    <h7><i><b>Human Rescources Panel</b></i></h7></br>
    <a href="?page=newpilots">New Pilots</a></br>
    <a href="?page=editpilots">Edit Pilots</a></br>
    <a href="viewcomments.php">View Comments</a></br>
    <a href="viewsitecomments.php">View Site Comments</a></br>
<a href="?page=addnews">Post News</a></br>
<a href="?page=editnews">Edit News</a></br>

   <?php
   }
   if($data['bm'] == 1)
    {?>
    <center>
     <h7><i><b>Executive Staff Panel</b></i></h7></br>
     <a href="edithub.php?hub=<?php echo $data['hub']; ?>">Edit Hub Page</a></br>
     <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br>
     <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br>
     <a href="awards.php">Grant Award</a></br>
    <a href="addevent">Add Event</a></br>
     <a href="manageevents.php">Manage Events</a></br>
   	<a href="?page=addnews">Post News</a></br>
<a href="?page=editnews">Edit News</a></br>
 <a href="pilotrec.php">Pilot Records</a></br>
    <a href="?page=newpilots&staffid=<? echo "{$data["login"]}"?>">New Pilots</a>  <font color="#0066FF" size="3" face="Times New Roman, Times, serif"><b><? echo"$newprow"; ?></font></b></br>
     <a href="?page=editpilots">Edit Pilots</a></br>
     <a href="viewcomments.php">View Comments</a></br>
     <a href="viewsitecomments.php">View Site Comments</a></br>
   
   <?php
   }
  }
  } }
}
else
{?>
<script>javascript:alert("Log In Failed!")</script>
<?
  echo '<center><FONT COLOR =ff001b> Your <i>Pilot ID And/Or Password</i> is wrong!</center></FONT COLOR>';?>
<style type="text/css">
.idBox {
width:50px;
}
.passwordBox {
width:80px;
}
</style>

<table border="0" align="center">
<form action="<? $_SERVER['PHP_SELF']; ?>" method="post">
  <tr>
    <td align="center">ID:</td><td align="center">ASA<input type="text" name="user" class="idBox"></td>
  </tr>
  <tr>
    <td align="center">Password:</td><td align="center"><input type="password" name="pwd" class="passwordBox"></td>
  </tr>
  <tr>
    <td></td><td align="center"><p align="center">
      <input type="submit" name="login" value="Login">
    </p>
      <p align="center">        <a href="#">Forgot Password</a></p></td>
  </tr>
</table>
<?
}?>
<? } else {?>
<style type="text/css">
.idBox {
width:50px;
}
.passwordBox {
width:80px;
}
</style>

<table border="0" align="center">
<form action="<? $_SERVER['PHP_SELF']; ?>" method="post"> 
  <tr>
    <td align="center">ID:</td><td align="center">ASA<input type="text" name="user" class="idBox"></td>
  </tr>
  <tr>
    <td align="center">Password:</td><td align="center"><input type="password" name="pwd" class="passwordBox"></td>
  </tr>
  <tr>
    <td></td><td align="center"><p>
      <input type="submit" name="login" value="Login">
      </p>
      <p><a href="#">Forgot Password</a> </p></td>
  </tr>
</table>
<?php } ?>

<font color="#0066FF" size="3">

However if the users goes to another page this chunk of the site goes back to the login form instead of displaying all the user options.

Link to comment
Share on other sites

You never check if the session variable isset. If that variable isset then the user is logged on, so show them their options.

 

You check for $_POST, but if the user is just browsing pages, $_POST is not going to help you, you need see if $_SESSION['login'] has been set etc.

Link to comment
Share on other sites

Is their anymore suggestions I really need help and this is like the only thing delaying me on putting my site up. Once again here is my current login code

<?
session_start();
?>

<?
if(isset($_POST['user']))
{
//Include Config File For DB info..
include 'db.php';
//Connect TO The MySQL Server
$connect = mysql_connect($db_host,$db_username,$db_password)
  or die("MySQL Said:".mysql_error());
  
$database = mysql_select_db($db_database,$connect)
  or die("MySQl Said:".mysql_error());
  
$login = mysql_real_escape_string($_POST['user']);
$pwd = mysql_real_escape_string($_POST['pwd']);

$link = mysql_query("SELECT * FROM `pilots` where login='$login' and pwd='$pwd'")
  or die("MySQL Said:".mysql_error());
  
$count = mysql_num_rows($link);
$data = mysql_fetch_assoc($link);
$lname = $data["lname"];
$hub = $data["hub"];
$pwd = $data["pwd"];
$fname = $data["fname"];
$login= $data["login"];
$status= $data["status"];

$newp = mysql_query("SELECT * FROM `pilots` where status ='0'")
  or die("MySQL Said:".mysql_error());
  
  $newprow = mysql_num_rows($newp);
  $result = count($newp);
  


if($count == 1)
{




  if($data['status'] == 0)
   {
    echo '<center>Your Account Is Not Active.</center>';
   }
  else
  {
   if($data['status'] == 2)
    {
    echo '<center><FONT COLOR =ff001b>Your Account Has Been Suspended.</center></FONT COLOR>';?>
    <center><a href="logout.php">Log Out</a></br></center>
   
<?  }
   else
   {
     if($data['status'] == 3)
    {
    echo '<center>You Are Currently On L.O.A</center>';?>
  <a href="rfileloa.php?login=<? echo "{$data["login"]}"?>">Return From L.O.A</a></br><?
   }
   else
   {



$_SESSION['SESS_LOGGEDIN'] = TRUE;
$_SESSION['SESS_LNAME'] = $lname;
$_SESSION['SESS_HUB'] = $hub;
$_SESSION['SESS_FNAME'] = $fname;
$_SESSION['login'] = $login;
$_SESSION['status'] = $status;


?>
   <body link="#0066FF" vlink="#0066FF" alink="#0066FF">
   <center>Welcome Back <? echo"$fname"; ?> <? echo"$lname"; ?></center>
   <center>
   <h7><i><b>Pilots Panel</b></i></h7></br>
   <a href="?page=pirepform&lname=<? echo "{$data["lname"]}"?>">File Pirep</a></br>
   <a href="?page=fileloa&login=<? echo "{$data["login"]}"?>">File LOA</a></br>
   <a href="#">Signatures</a></br>
   <A HREF="?page=profile&login=<? echo "{$data["login"]}"?> ">My Profile</a></br>
   <a href="?page=editp&login=<? echo "{$data["login"]}"?>">Edit My Profile</a></br>
   <a href="?page=events">Events</a></br>
   <a href="?page=rosterphp">VIew Roster</a></br>
   <a href="#"><font color="#FF0000">Resignation Form</font Color></br>
   <a href="logout.php">Log Out</a></br>
   
   <br>
   <h7><i><b>Pilots Tools</b></i></h7></br>
   <a href="http://www.fspassengers.com/"> FS Passengers</a></br>
   </center>
  
    <?php
   if($data['hm'] == 1)
    {?>
     <center>
    <h7><i><b>Hub Manager Panel</b></i></h7></br>
     <a href="?page=addnews_hub">Add News</a></br>
 <a href="?page=edithub">Edit Hub Page</a></br>
     <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br>
     <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br>
     <a href="awards.php">Grant Award</a></br>
    </center>
    <?php
   }
   if($data['fm'] == 1)
    {?>
     <center>
    <h7><i><b>Fleet Manager Panel</b></i></h7></br>
     <a href="addaircraft.php">Add Aircraft</a></br>
     <a href="manageaircraft.php">Manage Aircraft</a>
     </center>
    <?php
   }
   if($data['ed'] == 1)
    {?>
   <center>
    <h7><i><b>Events Director Panel</b></i></h7></br>
    <a href="?page=addevent">Add Event</a></br>
    <a href="?page=manageevents">Manage Events</a></br>
    <a href="postnews.php">Post News</a></br>


</center>
    <?php
   }
   if($data['hr'] == 1)
    { ?>
    <center>
    <h7><i><b>Human Rescources Panel</b></i></h7></br>
    <a href="?page=newpilots">New Pilots</a></br>
    <a href="?page=editpilots">Edit Pilots</a></br>
    <a href="viewcomments.php">View Comments</a></br>
    <a href="viewsitecomments.php">View Site Comments</a></br>
<a href="?page=addnews">Post News</a></br>
<a href="?page=editnews">Edit News</a></br>

   <?php
   }
   if($data['bm'] == 1)
    {?>
    <center>
     <h7><i><b>Executive Staff Panel</b></i></h7></br>
     <a href="?page=edithub">Edit Hub Page</a></br>
     <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br>
     <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br>
     <a href="awards.php">Grant Award</a></br>
    <a href="addevent">Add Event</a></br>
     <a href="manageevents.php">Manage Events</a></br>
   	<a href="?page=addnews">Post News</a></br>
<a href="?page=editnews">Edit News</a></br>
 <a href="pilotrec.php">Pilot Records</a></br>
    <a href="?page=newpilots&staffid=<? echo "{$data["login"]}"?>">New Pilots</a>  <font color="#0066FF" size="3" face="Times New Roman, Times, serif"><b><? echo"$newprow"; ?></font></b></br>
     <a href="?page=editpilots">Edit Pilots</a></br>
     <a href="viewcomments.php">View Comments</a></br>
     <a href="viewsitecomments.php">View Site Comments</a></br>
   
   <?php
   }
  }
  } }
}
else
{?>
<script>javascript:alert("Log In Failed!")</script>
<?
  echo '<center><FONT COLOR =ff001b> Your <i>Pilot ID And/Or Password</i> is wrong!</center></FONT COLOR>';?>
<style type="text/css">
.idBox {
width:50px;
}
.passwordBox {
width:80px;
}
</style>

<table border="0" align="center">
<form action="<? $_SERVER['PHP_SELF']; ?>" method="post">
  <tr>
    <td align="center">ID:</td><td align="center">ASA<input type="text" name="user" class="idBox"></td>
  </tr>
  <tr>
    <td align="center">Password:</td><td align="center"><input type="password" name="pwd" class="passwordBox"></td>
  </tr>
  <tr>
    <td></td><td align="center"><p align="center">
      <input type="submit" name="login" value="Login">
    </p>
      <p align="center">        <a href="#">Forgot Password</a></p></td>
  </tr>
</table>
<?
}?>
<? } else {?>
<style type="text/css">
.idBox {
width:50px;
}
.passwordBox {
width:80px;
}
</style>

<table border="0" align="center">
<form action="<? $_SERVER['PHP_SELF']; ?>" method="post"> 
  <tr>
    <td align="center">ID:</td><td align="center">ASA<input type="text" name="user" class="idBox"></td>
  </tr>
  <tr>
    <td align="center">Password:</td><td align="center"><input type="password" name="pwd" class="passwordBox"></td>
  </tr>
  <tr>
    <td></td><td align="center"><p>
      <input type="submit" name="login" value="Login">
      </p>
      <p><a href="#">Forgot Password</a> </p></td>
  </tr>
</table>
<?php } ?>

<font color="#0066FF" size="3">

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.