Hi all!!
i have here a code. What i want to happen is when i tick a radio button or checkbox, that will be the one displayed in the next form to be edited or deleted.
<html>
<head>
<title>Export to Excel</title>
</head>
<body>
<form method="post" >
<?php
define ('DB_NAME', 'vincegac_vince');
define ('DB_USER', 'root');
define ('DB_PASSWORD', '');
define ('DB_HOST', 'localhost');
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db(DB_NAME, $link);
if (!$db_selected) {
die('Can\'t use ' . DB_NAME . ': ' . mysql_error());
}
$UserName = $_POST["projname1"];
$strSQL = "SELECT * FROM employee WHERE projname = '$UserName'"; //KONTI PA!
$rs = mysql_query($strSQL);
//
?>
<table border="1">
<tr>
<th>Employee Number</th><th>First Name</th><th>Middle Name</th><th>Last Name</th><th>Home Address</th><th>Email Address</th>
<th>Office/project number</th><th>Mobile number</th><th>Home number</th><th>Position</th><th>Practice</th>
<th>Project Name</th><th>Project Manager</th><th>Team Leader</th>
</tr>
<?php
while($row = mysql_fetch_assoc($rs)) {
?>
<tr>
<td><input name="emp_number" size="10" type="checkbox" value="" readonly="readonly"/><?php echo $row['emp_number'] ?></td>
<td><input name="fname" size="10" type="text" value="<?php echo $row['fname'] ?>"/></td>
<td><input name="mname" size="10" type="text" value="<?php echo $row['mname'] ?>"/></td>
<td><input name="lname" size="10" type="text" value="<?php echo $row['lname'] ?>" /></td>
<td><input name="homeadd" size="10" type="text" value="<?php echo $row['homeadd'] ?>" /></td>
<td><input name="emailadd" size="10" type="text" value="<?php echo $row['emailadd'] ?>" /></td>
<td><input name="ofcnum" size="10" type="text" value="<?php echo $row['ofcnum'] ?>" /></td>
<td><input name="mobilenum" size="10" type="text" value="<?php echo $row['mobilenum'] ?>" /></td>
<td><input name="homenum" size="10" type="text" value="<?php echo $row['homenum'] ?>" /></td>
<td><input name="position" size="10" type="text" value="<?php echo $row['position'] ?>"/></td>
<td><input name="practice" size="10" type="text" value="<?php echo $row['practice'] ?>" /></td>
<td><input name="projname" size="10" type="text" value="<?php echo $row['projname'] ?>" readonly="readonly"/></td>
<td><input name="projmgr" size="10" type="text" value="<?php echo $row['projmgr'] ?>" readonly="readonly"/></td>
<td><input name="teamlead" size="10" type="text" value="<?php echo $row['teamlead'] ?>" /></td>
</tr>
<?php
}
?>
</table>
<input type="submit" name="edit" value="Edit" onclick="this.form.action='search.php'"/>
<input type="submit" name="del" value="Delete" onclick="this.form.action='delete.php'"/></td>
<?php mysql_close(); ?>
<p><a href="index.php"> Home</a> <a href="demo-form.php"> Add Member</a></p>
</form>
</body>
</html>
I HOPE SOMEONE CAN HELP ME. Thanks! :)