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
29 changes: 29 additions & 0 deletions davit_gelovani/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!doctype HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Challange 1</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
</head>
<body class="container">
<form action="/upload.php" method="POST" enctype="multipart/form-data">
<legend>Fill the form:</legend>
<div class="mb-3">
<label for="nameInput" class="form-label">Name</label>
<input type="text" name="name" class="form-control" id="nameInput" aria-describedby="emailHelp">
</div>
<div class="mb-3">
<label for="surnameInput" class="form-label">Surname</label>
<input type="text" name="surname" class="form-control" id="surnameInput" aria-describedby="emailHelp">
</div>
<div class="mb-3">
<label for="formFile" class="form-label">Upload your profile picture</label>
<input class="form-control" name="profile" type="file" id="formFile">
</div>

<input type="submit" name="submit" class="btn btn-success" />
</form>
</body>

</html>
28 changes: 28 additions & 0 deletions davit_gelovani/upload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Challange 1</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
</head>
<body class="container">
<?php
if(isset($_POST['submit']) && isset($_FILES['profile']) && $_POST['name'] && $_POST['surname']){
if(ctype_alpha($_POST['name']) || ctype_alpha($_POST['surname'])){
print '<h1>' . 'Name:' .'</h1>' . $_POST['name'];
print '<h1>' . 'Surname:' .'</h1>' . $_POST['surname'];
print '<h1>Profile Picture:</h1>';
}else{
echo "<div class='alert alert-danger'>Name and surname should be written with letters A-z</div>";
}
echo '<h1>Image</h1>';
$imageData = file_get_contents($_FILES['profile']['tmp_name']);
echo sprintf('<img src="data:image/png;base64,%s" />', base64_encode($imageData));

} else{
header("Location: index.php");
}?>

</body>
</html>
19 changes: 0 additions & 19 deletions oto_zakalshvili/form.php

This file was deleted.

9 changes: 0 additions & 9 deletions oto_zakalshvili/index.php

This file was deleted.