Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions gio_tasoshvili/form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<section>
<h1> Please Fill These Forms </h1>
<form action="form.php" method="post" enctype="multipart/form-data">
<input type="text" name="name" placeholder="Name" required/>
<input type="text" name="surname" placeholder="Surname" required>
<input type="file" name="image" required>
<input type="submit" name="submit" />
</section>
</form>
</body>
</html>



<?php

if($_SERVER['REQUEST_METHOD']=="POST"){
if($_POST['name'] && $_POST['surname']){
if(ctype_alpha($_POST['name'])=='true' && ctype_alpha($_POST['surname'])=='true'){


$image=$_FILES['image']?? null;

if(!is_dir('images')){
mkdir('images');
}
if($image){
$imagePath= 'images/'. $image['name'];
move_uploaded_file($image['tmp_name'], $imagePath);
?>
<figure class="personal-info">
<figcaption class="name-surname">
<?php print $_POST['name']. ' ' .$_POST['surname'] .'<br>'; ?>
</figcaption>
<img src="<?php echo'images/'.$image['name'] ?> " width=300px alt="Your Image">
</figure>
<?php
}
}else{
$letterError = "Please Fill Tabs in Latin Letters Only (A-Z)";
echo $letterError;
}
}
}
?>
</html>
30 changes: 30 additions & 0 deletions gio_tasoshvili/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
section {
width: 400px;
height: 120px;
margin-top: 100px;
margin-left: auto;
margin-right: auto;
background-color: aquamarine;

}
h1{
width: 243px;
padding-top: 7px;
margin-left: auto;
margin-right: auto;
margin-bottom: 16px;
}
input {
margin-bottom: 10px;
margin-left: 15px;
}
.personal-info{
width: 300px;
margin-left: auto;
margin-right: auto;
}
.name-surname{
color:rgb(66, 99, 199);
font-size: 30px;
padding-left: 50px;
}