updates
This commit is contained in:
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>
|
||||
|
||||
Reference in New Issue
Block a user