0

can anybody help me for making a login page .... only after successful login (with userid and password provided to user) he will be allowed for further pages.

here i want to display email ids' information used by a company....the user can delete or update the emailids or can make a new 2...

of course database has more than one companies emailids saved.. but should display only those data which are linked wid dat userid and password(each company will have distinct uid and password).
i hope i can u make u understand :( plz rply soon .

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
	background-color: #87AEC5;
}
-->
</style></head>
<body>
<?php
include("config.php");

$sql="SELECT * FROM contact";
$result=mysql_query($sql);?>
<table align="center" width="700" border="0"><tr><td><?php
echo "<form name='form1' method=post action=''>"; 
echo "<table border='0' cellspacing='0' cellpadding='2' width='600' align='center'>"; 
echo"<tr bgcolor='#ffffff'>";
echo"<td>&nbsp;</td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>emailid</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>forwarding</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>autoresponse</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>company</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'><strong>Password</strong></td>";
echo"<td align='center' bgcolor='#FFFFFF'>&nbsp;</td></tr>";
while($rows=mysql_fetch_array($result)){

echo"<tr bgcolor='#ffffff'>";
echo"<td>";
echo"<input type = 'checkbox' name='box[]' value=\"".$rows['emailid']."\"'</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['emailid']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['forwarding']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['autoresponse']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['company']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>".$rows['password']."</td>";
echo"<td align='center' bgcolor='#FFFFFF'>&nbsp;</td></tr>";
}

?>
  <tr>
    <td colspan =6 align=center>&nbsp;</td>
  </tr>
  <tr><td colspan =6 align=center><input type="button" name="new" value="New" onClick="window.location.href='second.php'" />
  <input type="button" name="edit" value="To Edit" onClick="window.location.href='selectid.php'">
    <input type="submit" value="Delete" name="delete">
    <label></label>
</td>
</tr></table>
</form></td></tr></table>

<?php
if(isset($_POST['delete'])){//check to see if the delete button has been pressed

   if(isset($_POST['box'])){ //check to see if any boxes have been checked 
        $num = 0;//used to count the number of rows that were deleted
        $box = $_POST['box'];
        while (list ($key,$val) = @each ($box)) { //loop through all the checkboxes
              $num++;
              $sqldel="DELETE FROM contact WHERE emailid='$val'";//delete any that match id
              $resdel=mysql_query($sqldel);//send the query to mysql
        }
        //print the logs that were deleted
       echo"$num record(s) have been deleted.";
	   echo "<meta http-equiv=\"refresh\" content=\"0;URL=eg3.php\">";
	   //<META HTTP-EQUIV=Refresh CONTENT="3; URL=eg2.php">
   }
   else{//no boxes checked
   echo "No records selected.";
   }
}
?>

</center>


</body> 
</html>

This page needs a user log in .. what to do ?????

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by pearll
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.