input assignment completed.

This commit is contained in:
Joshua Ashton
2025-02-06 14:14:45 -07:00
parent fd3efd1226
commit 8a4fd19fd4
7 changed files with 172 additions and 0 deletions
View File
View File
+118
View File
@@ -0,0 +1,118 @@
* {
margin: 0;
padding: 0;
}
body {
/* Positioning */
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
/* Styling */
background-color: #bbedbe;
}
h1 {
/* Positioning */
width: 80%;
padding: 2vw;
/* Font */
font-size: 8vw;
text-align: center;
}
h3 {
font-size: 4vw;
}
h5 {
font-size: 2vw;
}
h1,
h3,
h5,
p,
input {
color: #0e3610;
}
#form {
/* Positioning */
width: 80%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
form {
/* Form Shape */
width: 60%;
padding: 2.5vw 5vw 2.5vw 5vw;
/* Positioning */
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.row {
/* Row Shape */
width: 100%;
display: flex;
}
input {
/* Input Shape */
width: 50%;
padding: 1vw;
margin: 1vw;
border: none;
border-radius: 18px;
/* Styling */
background-color: #f1fbf2;
/* Font */
font-size: 1vw;
font-weight: 400;
}
button {
/* Button Shape */
width: 60%;
padding: 1vw;
border: none;
border-radius: 18px;
/* Font */
color: white;
font-size: 1vw;
font-weight: 600;
/* Transition for hover */
transition-duration: 500ms;
background-color: #1c6b20;
}
button:hover {
background-color: #26942D;
}
#confirmation {
width: 60%;
padding: 5vw 0 5vw 0;
border-radius: 18px;
background-color: #57d45f;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
View File
+54
View File
@@ -0,0 +1,54 @@
<?php
if (isset($_POST['first_name']))
$first_name = $_POST['first_name'];
if (isset($_POST['last_name']))
$last_name = $_POST['last_name'];
if (isset($_POST['email']))
$email = $_POST['email'];
if (isset($_POST['phone_number']))
$phone_number = $_POST['phone_number'];
?>
<!doctype html>
<html lang="en">
<head>
<title>Input</title>
<link href="css/styles.css" rel="stylesheet" type="text/css">
<script src="js/index.js"></script>
</head>
<body>
<h1>Input Assignment</h1>
<?php
if ($first_name || $last_name || $email || $phone_number) {
echo '
<div id="confirmation">
<h3>Thank you for contacting me!</h3>
<h5>Your submitted information is:</h5>
<div id="information">
<p><strong>Name: </strong>' . $last_name . ', ' . $first_name . '</p>
<p><strong>Email: </strong>' . $email . '</p>
<p><strong>Phone: </strong>' . $phone_number . '</p>
</div>
</div>
';
} else {
echo '
<div id="form">
<form method="post">
<div class="row">
<input name="first_name" type="text" placeholder="Josh">
<input name="last_name" type="text" placeholder="Ashton">
</div>
<div class="row">
<input name="email" type="email" placeholder="me@joshashton.dev">
<input name="phone_number" type="text" placeholder="123 456 7890">
</div>
<button>Submit</button>
</form>
</div>
';
}
?>
</body>
</html>
View File
View File