Skip to content

Commit

Permalink
aa
Browse files Browse the repository at this point in the history
  • Loading branch information
Truckerbug committed Oct 14, 2023
1 parent 615a00a commit 22267c9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
16 changes: 0 additions & 16 deletions pages/cafe/review/formfill.php
Original file line number Diff line number Diff line change
@@ -1,16 +0,0 @@
<?php
if(isset($_POST['name']) && isset($_POST['email'])) {
$data = $_POST['name'] . '-' . $_POST['email'] . "\n";
$filename = date('YmdHis').".txt";
$ret = file_put_contents($filename, $data, FILE_APPEND | LOCK_EX);
if($ret === false) {
die('There was an error writing this file');
}
else {
echo "$ret bytes written to file";
}
}
else {
die('no post data to process');
}
?>
17 changes: 17 additions & 0 deletions pages/cafe/review/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,21 @@ <h5 id="fh5">Feedback helps us improve our cafe.</h6>

<button type="submit" class="btn btn-primary">Submit</button>

<?php
if(isset($_POST['name']) && isset($_POST['email'])) {
$data = $_POST['name'] . '-' . $_POST['email'] . "\n";
$filename = date('YmdHis').".txt";
$ret = file_put_contents($filename, $data, FILE_APPEND | LOCK_EX);
if($ret === false) {
die('There was an error writing this file');
}
else {
echo "$ret bytes written to file";
}
}
else {
die('no post data to process');
}
?>

</form>

0 comments on commit 22267c9

Please sign in to comment.