<?php
include('config.php');
if(isset($_REQUEST['eid']))
{
$id=$_REQUEST['eid'];
$query=mysql_query("select *from registration where userId='$id'")or
die(mysql_error());
$row=mysql_fetch_array($query);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit form</title>
</head>
<body>
<form id="form1" name="frm1" action="update.php?eid=<?php echo $row['userId']; ?>" method="POST" enctype="multipart/form-data">
<div id="error_div"></div>
<table align="center" border="2">
<h1 align="center">Edit form</h1>
<tr>
<td>id:</td>
<td><input type="text" name="txt_id" id="txt_id" value="<?php echo $row['userId']; ?>" /></td>
</tr>
<tr>
<td>Username:<sup style="color:#C30">*</sup></td>
<td><input type="text" name="txt_user" id="txt_user" value="<?php echo $row['userName']; ?>" /></td>
</tr>
<tr>
<td>Password:<sup style="color:#C30">*</sup></td>
<td><input type="text" name="txt_pwd" id="txt_pwd" value="<?php echo $row['password']; ?>" /></td>
</tr>
<tr>
<td>Address:<sup style="color:#C30">*</sup></td>
<td><input type="text" name="txt_add" id="txr_add" value="<?php echo $row['Address']; ?>" /></td>
</tr>
<tr>
<td>State:-</td>
<td><select name="state" id="state">
<option value="">--Select State--</option>
<?php
if($row['state']=='Gujarat')
{
?>
<option value="Gujarat" selected="selected">Gujarat</option>
<option value="Maharashtra">Maharashtra</option>
<option value="Goa">Goa</option>
<option value="Assam">Assam</option>
<option value="Bihar">Bihar</option>
<option value="Arunachal Pradesh">Arunachal Prdesh</option>
<option value="Uttar Pradesh">Uttar Prdesh</option>
<option value="Madhya Pradesh">Madhya Prdesh</option>
<option value="Andhra Pradesh">Andhra Prdesh</option>
<?php
}elseif($row['state']=='Maharashtra')
{
?>
<option value="Gujarat">Gujarat</option>
<option value="Maharashtra" selected="selected">Maharashtra</option>
<option value="Goa">Goa</option>
<option value="Assam">Assam</option>
<option value="Bihar">Bihar</option>
<option value="Arunachal Pradesh">Arunachal Prdesh</option>
<option value="Uttar Pradesh">Uttar Prdesh</option>
<option value="Madhya Pradesh">Madhya Prdesh</option>
<option value="Andhra Pradesh">Andhra Prdesh</option>
<?php
}elseif($row['state']=='Goa')
{
?>
<option value="Gujarat">Gujarat</option>
<option value="Maharashtra">Maharashtra</option>
<option value="Goa" selected="selected">Goa</option>
<option value="Assam">Assam</option>
<option value="Bihar">Bihar</option>
<option value="Arunachal Pradesh">Arunachal Prdesh</option>
<option value="Uttar Pradesh">Uttar Prdesh</option>
<option value="Madhya Pradesh">Madhya Prdesh</option>
<option value="Andhra Pradesh">Andhra Prdesh</option>
<?php
}elseif($row['state']=='Assam')
{
?>
<option value="Gujarat">Gujarat</option>
<option value="Maharashtra">Maharashtra</option>
<option value="Goa">Goa</option>
<option value="Assam" selected="selected">Assam</option>
<option value="Bihar">Bihar</option>
<option value="Arunachal Pradesh">Arunachal Prdesh</option>
<option value="Uttar Pradesh">Uttar Prdesh</option>
<option value="Madhya Pradesh">Madhya Prdesh</option>
<option value="Andhra Pradesh">Andhra Prdesh</option>
<?php
}elseif($row['state']=='Bihar')
{
?>
<option value="Gujarat">Gujarat</option>
<option value="Maharashtra">Maharashtra</option>
<option value="Goa">Goa</option>
<option value="Assam">Assam</option>
<option value="Bihar" selected="selected">Bihar</option>
<option value="Arunachal Pradesh">Arunachal Prdesh</option>
<option value="Uttar Pradesh">Uttar Prdesh</option>
<option value="Madhya Pradesh">Madhya Prdesh</option>
<option value="Andhra Pradesh">Andhra Prdesh</option>
<?php
}elseif($row['state']=='Arunachal Pradesh')
{
?>
<option value="Gujarat">Gujarat</option>
<option value="Maharashtra">Maharashtra</option>
<option value="Goa">Goa</option>
<option value="Assam">Assam</option>
<option value="Bihar">Bihar</option>
<option value="Arunachal Pradesh" selected="selected">Arunachal Prdesh</option>
<option value="Uttar Pradesh">Uttar Prdesh</option>
<option value="Madhya Pradesh">Madhya Prdesh</option>
<option value="Andhra Pradesh">Andhra Prdesh</option>
<?php
}elseif($row['state']=='Uttar Pradesh')
{
?>
<option value="Gujarat">Gujarat</option>
<option value="Maharashtra">Maharashtra</option>
<option value="Goa">Goa</option>
<option value="Assam">Assam</option>
<option value="Bihar">Bihar</option>
<option value="Arunachal Pradesh">Arunachal Prdesh</option>
<option value="Uttar Pradesh" selected="selected">Uttar Prdesh</option>
<option value="Madhya Pradesh">Madhya Prdesh</option>
<option value="Andhra Pradesh">Andhra Prdesh</option>
<?php
}elseif($row['state']=='Madhya Pradesh')
{
?>
<option value="Gujarat">Gujarat</option>
<option value="Maharashtra">Maharashtra</option>
<option value="Goa">Goa</option>
<option value="Assam">Assam</option>
<option value="Bihar">Bihar</option>
<option value="Arunachal Pradesh">Arunachal Prdesh</option>
<option value="Uttar Pradesh">Uttar Prdesh</option>
<option value="Madhya Pradesh" selected="selected">Madhya Prdesh</option>
<option value="Andhra Pradesh">Andhra Prdesh</option>
<?php
}elseif($row['state']=='Andhra Pradesh')
{
?>
<option value="Gujarat">Gujarat</option>
<option value="Maharashtra">Maharashtra</option>
<option value="Goa">Goa</option>
<option value="Assam">Assam</option>
<option value="Bihar">Bihar</option>
<option value="Arunachal Pradesh">Arunachal Prdesh</option>
<option value="Uttar Pradesh">Uttar Prdesh</option>
<option value="Madhya Pradesh">Madhya Prdesh</option>
<option value="Andhra Pradesh" selected="selected">Andhra Prdesh</option>
<?php
}
?>
</select></td>
</tr>
<tr>
<td>City:-</td>
<td>
<select name="city" id="city">
<option value="">--select City--</option>
<?php
if($row['city']=='Gandhinagar')
{
?>
<option value="Gandhinagar" selected="selected">Gandhinagar</option>
<option value="Mumbai">Mumbai</option>
<option value="Panji">Panji</option>
<option value="Dispur">Dispur</option>
<option value="Patna">Patna</option>
<option value="Itanagar">Itanagar</option>
<option value="Lucknow">Lucknow</option>
<option value="Bhopal">Bhopal</option>
<option value="Vijaywada">Vijaywada</option>
<?php
}elseif($row['city']=='Mumbai')
{
?>
<option value="Gandhinagar">Gandhinagar</option>
<option value="Mumbai" selected="selected">Mumbai</option>
<option value="Panji">Panji</option>
<option value="Dispur">Dispur</option>
<option value="Patna">Patna</option>
<option value="Itanagar">Itanagar</option>
<option value="Lucknow">Lucknow</option>
<option value="Bhopal">Bhopal</option>
<option value="Vijaywada">Vijaywada</option>
<?php
}elseif($row['city']=='Panji')
{
?>
<option value="Gandhinagar">Gandhinagar</option>
<option value="Mumbai">Mumbai</option>
<option value="Panji" selected="selected">Panji</option>
<option value="Dispur">Dispur</option>
<option value="Patna">Patna</option>
<option value="Itanagar">Itanagar</option>
<option value="Lucknow">Lucknow</option>
<option value="Bhopal">Bhopal</option>
<option value="Vijaywada">Vijaywada</option>
<?php
}elseif($row['city']=='Dispur')
{
?>
<option value="Gandhinagar">Gandhinagar</option>
<option value="Mumbai">Mumbai</option>
<option value="Panji">Panji</option>
<option value="Dispur" selected="selected">Dispur</option>
<option value="Patna">Patna</option>
<option value="Itanagar">Itanagar</option>
<option value="Lucknow">Lucknow</option>
<option value="Bhopal">Bhopal</option>
<option value="Vijaywada">Vijaywada</option>
<?php
}elseif($row['city']=='Patna')
{
?>
<option value="Gandhinagar">Gandhinagar</option>
<option value="Mumbai">Mumbai</option>
<option value="Panji">Panji</option>
<option value="Dispur">Dispur</option>
<option value="Patna" selected="selected">Patna</option>
<option value="Itanagar">Itanagar</option>
<option value="Lucknow">Lucknow</option>
<option value="Bhopal">Bhopal</option>
<option value="Vijaywada">Vijaywada</option>
<?php
}elseif($row['city']=='Itanagar')
{
?>
<option value="Gandhinagar">Gandhinagar</option>
<option value="Mumbai">Mumbai</option>
<option value="Panji">Panji</option>
<option value="Dispur">Dispur</option>
<option value="Patna">Patna</option>
<option value="Itanagar" selected="selected">Itanagar</option>
<option value="Lucknow">Lucknow</option>
<option value="Bhopal">Bhopal</option>
<option value="Vijaywada">Vijaywada</option>
<?php
}elseif($row['city']=='Lucknow')
{
?>
<option value="Gandhinagar">Gandhinagar</option>
<option value="Mumbai">Mumbai</option>
<option value="Panji">Panji</option>
<option value="Dispur">Dispur</option>
<option value="Patna">Patna</option>
<option value="Itanagar">Itanagar</option>
<option value="Lucknow" selected="selected">Lucknow</option>
<option value="Bhopal">Bhopal</option>
<option value="Vijaywada">Vijaywada</option>
<?php
}elseif($row['city']=='Bhopal')
{
?>
<option value="Gandhinagar">Gandhinagar</option>
<option value="Mumbai">Mumbai</option>
<option value="Panji">Panji</option>
<option value="Dispur">Dispur</option>
<option value="Patna">Patna</option>
<option value="Itanagar">Itanagar</option>
<option value="Lucknow">Lucknow</option>
<option value="Bhopal" selected="selected">Bhopal</option>
<option value="Vijaywada">Vijaywada</option>
<?php
}elseif($row['city']=='Vijaywada')
{
?>
<option value="Gandhinagar">Gandhinagar</option>
<option value="Mumbai">Mumbai</option>
<option value="Panji">Panji</option>
<option value="Dispur">Dispur</option>
<option value="Patna">Patna</option>
<option value="Itanagar">Itanagar</option>
<option value="Lucknow">Lucknow</option>
<option value="Bhopal">Bhopal</option>
<option value="Vijaywada" selected="selected">Vijaywada</option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>Email:-</td>
<td><input name="txt_email" id="txt_email" type="text" value="<?php echo $row['email']; ?>" placeholder="Enter Your Email" size="30" /></td>
</tr>
<tr>
<td>DateOfBirth</br>
(yyyy-mm-dd):-</td>
<td><input type="date" name="txt_date" id="txt_date" value="<?php echo $row['date']; ?>" placeholder="Enter Your DateOfBirth"></td>
</tr>
<tr>
<td>PhoneNo:-</td>
<td><input name="txt_phone" id="txt_phone" type="text" value="<?php echo $row['phoneNo']; ?>" placeholder="Enter Your PhoneNo" size="30" /></td>
</tr>
<tr>
<td>Gender:-</td>
<td>
<label>
<?php if($row['gender']=='Male')
{
?>
<input type="radio" name="gender" value="Male" checked="checked" />
Male
<input type="radio" name="gender" value="Female"/>
Female
<?php
}
else
{
?>
<input type="radio" name="gender" value="Male"
/>
Male
<input type="radio" name="gender" value="Female" checked="checked" />
Female
<?php
}
?>
<br />
</td>
</tr>
<tr>
<td> Hobby:-</td>
<td><?php
error_reporting(0);
$hb=array('Cricket','Tennis','Football','Hocky');
$ex=explode(',',$row['Hobby']);
foreach($hb as $r)
{
if($ex[0]==$r || $ex[1]==$r || $ex[2]==$r || $ex[3]==$r)
{
?>
<input type="checkbox" name="Hobby[]" value="<?php echo $r;?>" checked="checked">
<?php echo $r;?>
<?php
}
else
{
?>
<input type="checkbox" name="Hobby[]" value="<?php echo $r;?>">
<?php echo $r;?>
<?php
}
}
?>
</td>
</tr>
<tr>
<td>Photo:-</td>
<td>
<input type="hidden" name="tmp_name" value="<?php echo $row['Photo'];?>"/>
<input type="file" name="f1" value="<?php echo $row['Photo'];?>"/></td>
</tr>
<tr>
<td align="center"><input name="btn_Edit" type="submit" value="Submit"/></td>
</tr>
</table>
</form>
</body>
</html>
No comments:
Post a Comment