Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?php
$host = "localhost"; // хост
$username = "root"; // user
$password = ""; //pass
$db = "sistema"; //bd
mysql_connect("$host","$username","$password");
mysql_select_db("$db");
$id = $_GET['id'];
$r = mysql_query("SELECT * FROM `tablicata` WHERE `id` = '$id'");
while($row = mysql_fetch_array($r)) {
$name = $row['name'];
$gender = $row['gender'];
$age = $row['age'];
$location = $row['location'];
$signature = $row['signature'];
$avatar = $row['avatar'];
}
if (!isset($_POST['promqna'])) {
?>
<form method="POST">
<table>
<tr>
<td>Name:</td>
<td><input type="text" name="name1" value="<?php echo$name;?>"></td>
</tr>
<tr>
<td>Gender:</td>
<td><input type="radio" name="gender1" value="1" >Мъж<br><input type="radio" name="gender1" value="2" >Жена</td>
</tr>
<tr>
<td>Age:</td>
<td><input type="text" name="age1" value="<?php echo$age;?>"></td>
</tr>
<tr>
<td>Location:</td>
<td><input type="text" name="location1" value="<?php echo$location;?>"></td>
</tr>
<tr>
<td>Signature:</td>
<td><input type="text" name="signature1" value="<?php echo$signature;?>"></td>
</tr>
<tr>
<td>Avatar:</td>
<td><input type="text" name="avatar1" value="<?php echo$avatar;?>"></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="promqna" value="Промяна" class="button"></td>
</tr>
</table>
</form>
<?php
}
else {
$name1 = htmlspecialchars($_POST['name1']);
$gender1 = htmlspecialchars($_POST['gender1']);
$age1 = htmlspecialchars($_POST['age1']);
$location1 = htmlspecialchars($_POST['location1']);
$signature1 = htmlspecialchars($_POST['signature1']);
$avatar1 = htmlspecialchars($_POST['avatar1']);
$update = mysql_query("UPDATE `tablicata` SET `gender` = '$gender1', `age` = '$age1', `name` = '$name1', `location` = '$location1',`signature` = '$signature1' , `avatar` = '$avatar1' WHERE `id` = '$id'");
echo "Успешно променихте записа. ";}
?>