vivekdizzal 0 Newbie Poster
<?php

$host = "localhost"; 
$user = "root"; 
$pass = ""; 
$db     = "register1"; 
$conn=mysql_connect($host, $user, $pass);
$db3=mysql_select_db($db,$conn) or die("Unable to connect to local database"); 
$caption = " Add ";
if($_GET['id'] != '') {
	$sel_qry = "SELECT * FROM details WHERE id = ".$_GET['id'];	
	$rs = mysql_query($sel_qry);
	$result_data = mysql_fetch_assoc($rs);	
	$caption = " Update ";
}
?>

<head>
<title user_create</title>
<script language="javascript" src="date_picker/ts_picker.js">
</script>
</head>
 <body> 
    <form name="tstest" method="post" action="user_add.php?id=<?Php echo $_GET['id']; ?>"> 
    <table width="400" align="center" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
        <td colspan="2" align="center" style="font-size:18px; font-weight:bold;">PERSONAL INFORMATION</td> 
          <input type="hidden" value="<?php echo $id?>" name="id"> 
      </tr> 
      <tr> 
        <td> </td> 
        <td> </td> 
      </tr> 
      <tr> 
        <td align="right">first_name: </td> 
        <td><input name="first_name" type="text" value="<?php echo $result_data['first_name'];?>"> </td> 
      </tr> 
      <tr> 
       <td align="right">last_name: </td> 
       <td><input name="last_name" type="text" value="<?php echo $result_data['last_name'];?>"> </td> 
      </tr> 
       <tr>
        <td align="right">Address:</td>
        <td><label for="textarea"></label>
        <textarea name="Address" id="textarea" cols="45" rows="5"><?php echo $result_data['Address'];?></textarea></td>
      </tr>
      <tr>
         <td align="right">gender </td>
         <?php
						switch($result_data['gender']) 
						{
							case female:	
								$female="Checked";
								break;
							case male:
								$male="Checked";
								break;
						}
					?>
         <td><input name="gender" type="radio"  value="female" id="female" <?php echo $female ?>>
         <label for="radio">female
           <input name="gender" type="radio" value="male" id="male" <?php echo $male ?>>
           male
         </label></td>
      </tr>
      <tr>
        <td align="right">Date:</td>
        <td><input type="Text" name="timestamp" value="<?php echo $result_data['timestamp'];?>">
<a href="javascript:show_calendar('document.tstest.timestamp', document.tstest.timestamp.value);"><img src="date_picker/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp"></a>
</td>
      </tr>
      <tr>
        <td align="right">Language_known</td>
        <?  ?>
            <td><input type="checkbox" name="Language_known[]" id="checkbox" value="English">
        <label for="checkbox">English<br>
          <input type="checkbox" name="Language_known[]"  value="Tamil" id="checkbox2">
          Tamil
          <br>
          <input type="checkbox" name="Language_known[]" value="Hindi" id="checkbox3">
        Hindi</label></td>
      </tr>
      <tr>
        <td align="right">Branch</td>
        <td><select name="select" id="select">
            <option value="coimbatore">coimbatore</option>
            <option value="tirupur">tirupur</option>
            <option value="chennai">chennai</option>
            <option value="erode">erode</option>
        </select></td>
      </tr>
      <tr>
        <td align="right">city:</td>
        <td><input name="city" type="text" value="<?php echo $result_data['city'];?>"></td>
      </tr>
      <tr> 
        <td align="right">mobile:</td> 
        <td><input name="mobile" type="text" maxlength="10" value="<?php echo $result_data['mobile'];?>"></td>
      </tr> 
      <tr> 
        <td align="right">Email : </td> 
        <td><input name="email" type="text" value="<?php echo $result_data['email'];?>"> </td> 
      </tr>
      <tr> 
        <td> </td> 
        <td> </td> 
      </tr> 
      <tr> 
        <td colspan="2" align="center"><input name="submit" type="submit" value="<?php echo $caption;?>"> <input name="reset" type="reset" value="Clear Form"></td> 
      </tr> 
    </table>
</form> 


    </body>