sync
This commit is contained in:
@@ -1,2 +1,5 @@
|
||||
</body>
|
||||
<?php
|
||||
echo '
|
||||
</body>
|
||||
</html>
|
||||
';
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
include_once('includes/functions.php');
|
||||
|
||||
/*
|
||||
* Creates a form from an associative array of fields.
|
||||
*
|
||||
* See includes/input_validation.php for the structure of a fields array.
|
||||
*/
|
||||
function generate_form($fields, $error)
|
||||
{
|
||||
$form = '
|
||||
<div class="standard_box outer_shadow form_container">
|
||||
<form method="' . $fields['method'] . '" action="' . $fields['action'] . '">
|
||||
';
|
||||
|
||||
foreach ($fields as $field => $metadata) {
|
||||
if ($field == 'method' || $field == 'action')
|
||||
continue;
|
||||
|
||||
$form .= '
|
||||
<div class="input_box inner_shadow">
|
||||
<label for="' . $field . '">' . ucwords($metadata['label']) . '</label>
|
||||
<input id="' . $field . '" name="' . $field . '" type="' . $metadata['type'] . '" placeholder="' . $metadata['placeholder'] . '">
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
$form .= '
|
||||
<input type="submit" class="submit_button">
|
||||
</form>
|
||||
';
|
||||
|
||||
if (!empty($error)) {
|
||||
$form .= '
|
||||
<div class="standard_box inner_shadow error">
|
||||
<p class="error">' . ucwords($error) . ' information!</p>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
$form .= '
|
||||
</div>
|
||||
';
|
||||
|
||||
return $form;
|
||||
}
|
||||
@@ -1,10 +1,14 @@
|
||||
<?php
|
||||
echo '
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Dummy Title</title>
|
||||
<link href="css/styles.css" type="text/css" rel="stylesheet">
|
||||
<script src="js/index.js"></script>
|
||||
</head>
|
||||
<head>
|
||||
<title>Vintage Coding</title>
|
||||
<link href="css/styles.css" type="text/css" rel="stylesheet">
|
||||
<script src="js/index.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body>
|
||||
';
|
||||
include_once('nav.php');
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
$nav = '
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="home.php">Home</a></li>
|
||||
<li><a href="account.php">Account</a></li>
|
||||
<li><a href="admin.php">Admin</a></li>
|
||||
<li><a href="articles.php">Articles</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="home.php">Home</a></li>
|
||||
<li><a href="account.php">Account</a></li>
|
||||
<li><a href="admin.php">Admin</a></li>
|
||||
<li><a href="articles.php">Articles</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
';
|
||||
|
||||
echo $nav;
|
||||
|
||||
Reference in New Issue
Block a user