Добавлен: 28.03.2023
Просмотров: 617
Скачиваний: 28
<input name="save" type="submit" value="Сохранить" />
</form>
<? if (isset($_POST['save'])){
$mysqli = new mysqli ("localhost", "root", "root", "pet");
$mysqli ->query("SET_NAMES 'utf8'");
$mysqli ->query("UPDATE `animal` SET `klichka`='".$klichka."', `vozrast`='".$vozrast."', `pol`='".$pol."', `opis`='".$opis."', `zabrali`='".$zabrali."' WHERE `id`='".$id."'");
$mysqli ->close();
if ((is_uploaded_file($_FILES["foto"]["tmp_name"]))&&($_FILES["foto"]["size"] < 1024*3*1024)&&($_FILES["foto"]["type"] == 'image/jpeg')){
unlink ('pet/'.$fotoprev);
$mysqli = new mysqli ("localhost", "root", "root", "pet");
$mysqli ->query("SET_NAMES 'utf8'");
$mysqli ->query("UPDATE `animal` SET `foto`='".$_FILES['foto']['name']."' WHERE id="."'".$id."'");
$mysqli ->close();
move_uploaded_file
(
$_FILES["foto"]["tmp_name"],
"pet"."/".iconv('utf-8','cp1251',$_FILES["foto"]["name"])
);
}
?>
<?
}
?>
</div>
</div>
</div>
</body>
</html>
pet.css
* {
text-decoration: none;
}
html
{
background-image: url('http://petlife/img/FON.jpg');
}
.rin {color: #000;
}
h1 {font-family:arial;}
.ron{
font-size: 1em; font-family:Times new roman;
text-indent:0;
border-right: 0.5px solid white;
border-right: 0.5px solid white;
border-bottom: 1px dotted White;
margin:0;
float:inherit;
background-color:#F4A460;
border-radius: 3px;
}
.ron:hover {background-color: #FF8C00}
summary
{
border: 1px outset;
background-color:#F4A460;
font-size: 1em; font-family:Times new roman;
text-indent:0;
margin:0;
float:inherit;
border-radius: 3px;
}
summary:hover {background-color: #FF8C00}
details summary::-webkit-details-marker {
display: none;
font-size: 1em;
font-family:Times new roman;
font-weight: bold; }
a {font-size: 1.1em; font-family:Times new roman; }
pre {font-size: 1.1em; font-weight: bold; font-family:Times new roman; color: black; text-indent:0;}
footer {font-size: 1.1em; }
#shapka {
margin:0;
height: 8em;
width: 98em;
}
#vso
{
height: 34em;
width: 98em;
}
#podval {
margin-left: -2em;
height: 5em;
width: 94em;
background-color: #F4A460;
}
#menu {
margin: auto;
background-color: #FFDEAD;
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
width: 40em;
}
#banner
{
margin: auto;
height: 3em;
width: 42em;
}
menu
{
margin:0;
height: 6em;
width: 37.5em;
text-align:center;
}
#cat
{
float:left;
width: 8.1em;
text-align:center;
}
#dog
{
float:left;
margin-left: 8em;
width: 8.2em;
text-align:center;
}
#mau
{
float:left;
text-align:center;
width: 7.2em;
border-radius: 3px;
font-size: 0.9em;
}
#onas
{
float:left;
text-align:center;
width: 5.2em;
border-radius: 3px;
font-size: 0.9em;
}
#onas:hover {background-color: #FF8C00}
#mau:hover {background-color: #FF8C00}
#nizpre
{
margin:0;
border: 0.5px outset white;
float:left;
width: 9em;
height: 2.8em;
text-align:center;
background-color:#F4A460;
}
#logo{
float:left;
width: 38em;
height:8em;
}
#topcent{
float:left;
width: 20em;
height:7.2em;
text-align:center;
font-size: 1.1em;
font-family:Times new roman;
}
#topright{
float:left;
width: 32em;
height:8em;
}
#imya{
float:left;
width: 25em;
height:4.9em;
text-align:center;
}
#textx{
float:left;