updates
This commit is contained in:
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Regular → Executable
+7
-7
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
$error = '';
|
||||
if (isset($_GET['error']))
|
||||
$error = $_GET['error'];
|
||||
$error = $_GET['error'];
|
||||
?>
|
||||
|
||||
<!doctype html>
|
||||
@@ -9,14 +9,14 @@ if (isset($_GET['error']))
|
||||
|
||||
<head>
|
||||
<title>Validation</title>
|
||||
<link href="css/styles.css" type="text/css" rel="stylesheet">
|
||||
<script src="js/index.js"></script>
|
||||
<link href="validation/css/styles.css" type="text/css" rel="stylesheet">
|
||||
<script src="validation/js/index.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Validation Assignment</h1>
|
||||
|
||||
<form action="process.php" method="post">
|
||||
<form action="validation/process.php" method="post">
|
||||
<input name="phone_number" type="text" placeholder="(xxx)xxx-xxxx" <?php $error ? 'value="' . $error . '"' : '' ?>>
|
||||
<div class="row">
|
||||
<button>Submit</button>
|
||||
@@ -25,7 +25,7 @@ if (isset($_GET['error']))
|
||||
</form>
|
||||
|
||||
<?php
|
||||
if ($error) {
|
||||
if ($error) {
|
||||
echo '
|
||||
<div class="card error">
|
||||
<h3 class="error">Invalid Format</h3>
|
||||
@@ -33,8 +33,8 @@ if ($error) {
|
||||
<p class="error">Phone number must be formatted as (xxx)xxx-xxxx.</p>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
+8
-8
@@ -2,16 +2,16 @@
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Dummy Title</title>
|
||||
<link href="css/styles.css" type="text/css" rel="stylesheet">
|
||||
<script src="js/index.js"></script>
|
||||
<title>Dummy Title</title>
|
||||
<link href="validation/css/styles.css" type="text/css" rel="stylesheet">
|
||||
<script src="validation/js/index.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Validation Assignment</h1>
|
||||
<?php
|
||||
validate($_POST['phone_number']);
|
||||
?>
|
||||
<h1>Validation Assignment</h1>
|
||||
<?php
|
||||
validate($_POST['phone_number']);
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -27,7 +27,7 @@ function validate($number)
|
||||
<div class="card success">
|
||||
<h3 class="success">Thank You!</h3>
|
||||
<p class="success">You entered: ' . $number . ', a valid phone number.</p>
|
||||
<img src="img/success.jpg" />
|
||||
<img src="validation/img/success.jpg" />
|
||||
</div>
|
||||
';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user