27 lines
No EOL
1,003 B
PHP
27 lines
No EOL
1,003 B
PHP
<?php
|
|
function form($title, $form_message, $inputs) { ?>
|
|
<form class='form' enctype="multipart/form-data" method="POST">
|
|
<h1 class="form-heading">
|
|
<?php echo $title ?>
|
|
</h1>
|
|
<span class='form-message'>
|
|
<?php echo $form_message ?>
|
|
</span>
|
|
<?php
|
|
foreach ($inputs as $kv) { ?>
|
|
<span class='form-key'>
|
|
<?php echo $kv['key'] ?>
|
|
</span>
|
|
|
|
<<?php echo (($kv['type'] == 'textarea') ? 'textarea' : 'input') ?>
|
|
class='form-input'
|
|
type="<?php echo $kv['type'] ?>"
|
|
name="<?php echo $kv['name'] ?>"
|
|
value="<?php echo $kv['default'] ?>"
|
|
>
|
|
<?php }
|
|
?>
|
|
<input class='form-button' type="Submit" name="Submit">
|
|
</form>
|
|
<?php }
|
|
?>
|