Upload New File
update.php
0 → 100644
<h1>Click What You Want To Update</h1> | ||
<form method="POST" action="#"> | ||
<input type="submit" name="action" value="Mobile Number" /> | ||
<input type="submit" name="action" value="Last Donated" /> | ||
<input type="submit" name="action" value="Address" /> | ||
</form> | ||
<form method="POST" action="#" > | ||
<?php | ||
$con = mysqli_connect("localhost", "id11481374_surya", "[email protected]", "id11481374_blood"); | ||
$ld=""; | ||
$cit=""; | ||
$num=""; | ||
$new=""; | ||
if($_SERVER['REQUEST_METHOD'] == 'POST'){ | ||
if(!empty($_POST['num1'])&& !empty($_POST['new'])) | ||
{ | ||
$new=$_POST['new']; | ||
$sp="UPDATE bloo SET mobile = $new WHERE mobile = $num"; | ||
$fun=mysqli_query($con,$sp); | ||
echo"Updated Successfully Thank You :)"; | ||
} | ||
else if($_POST['action']=='Mobile Number') | ||
{ | ||
echo"Enter Your Previous Mobile Number <br>"; | ||
echo"<input name='fname' type='text' class='textfield' id='num1' value='$num' /><br>"; | ||
echo"Enter Your New Mobile Number<br>"; | ||
echo"<input name='fname' type='text' class='textfield' id='new' value='$new' />"; | ||
echo "<input type='submit' name='submit' value='Submit'>"; | ||
} | ||
} | ||
if($_SERVER['REQUEST_METHOD'] == 'POST'){ | ||
if(!empty($_POST['num2'])&& !empty($_POST['cit'])) | ||
{ | ||
$cit=$_POST['cit']; | ||
$sp="UPDATE bloo SET city = $cit WHERE mobile = $num"; | ||
$fun=mysqli_query($con,$sp); | ||
echo"Updated Successfully Thank You :)"; | ||
} | ||
else if($_POST['action']=='Address') | ||
{ | ||
echo"Enter Your Mobile Number <br>"; | ||
echo"<input name='fname' type='text' class='textfield' id='num2' value='$num' /><br>"; | ||
echo"Enter Your New Address (City) <br>"; | ||
echo"<input name='fname' type='text' class='textfield' id='cit' value='$cit' />"; | ||
echo "<input type='submit' name='submit' value='Submit'>"; | ||
} | ||
} | ||
if($_SERVER['REQUEST_METHOD'] == 'POST'){ | ||
if(!empty($_POST['num3'])&& !empty($_POST['ld'])) | ||
{ | ||
$ld=$_POST['ld']; | ||
$sp="UPDATE bloo SET dd = $ld WHERE mobile = $num"; | ||
$fun=mysqli_query($con,$sp); | ||
echo"Updated Successfully Thank You :)"; | ||
} | ||
else if($_POST['action']=='Last Donated') | ||
{ | ||
echo"Enter Your Mobile Number<br>"; | ||
echo"<input name='fname' type='text' class='textfield' id='num3' value='$num' /><br>"; | ||
echo"How Many months ago You Have Donated Blood??(Enter Only Number)<br>"; | ||
echo"<input name='fname' type='text' class='textfield' id='ld' value='$ld' />"; | ||
echo "<input type='submit' name='submit' value='Submit'>"; | ||
} | ||
} | ||
?> | ||
</form> | ||
\ No newline at end of file |
Please register or sign in to comment