fixed apply and save

This commit is contained in:
Joshua Perry 2023-01-23 18:59:40 +00:00
parent fa203f16cc
commit f369120fcc
2 changed files with 5 additions and 5 deletions

View File

@ -62,14 +62,14 @@ class DatabaseTable {
} }
public function save($record) { public function save($record) {
if (\empty($record[$pk])) { if (empty($record[$this->pk])) {
\unset($record[$pk]); unset($record[$this->pk]);
} }
try { try {
insert($record); $this->insert($record);
} }
catch (\Exception $e) { catch (\Exception $e) {
update($record); $this->update($record);
} }
} }
} }

View File

@ -7,7 +7,7 @@
<section class="right"> <section class="right">
<h2>Apply for <?=$job->title?></h2> <h2>Apply for <?=$job->title?></h2>
<form action="apply.php" method="POST" enctype="multipart/form-data"> <form action="/jobs/apply" method="POST" enctype="multipart/form-data">
<label>Your name</label> <label>Your name</label>
<input type="text" name="name" /> <input type="text" name="name" />