The context is the following, i had a job interview assignment in which i failed to complete on time, now i’m trying to do this just for learning purposes and i’m having issues… it’s a product registration crud
- I’m doing something wrong with my including or form submition it’s a simple crud project that the user should be able to add a sale and any number of products that he made with the sale. i’m getting confused with my directories as well These are the 'relevant files ’ where they are: registro_produto\index.php ^ this index file has only a single line of code which is
<?php header("Location: public/template.php "); ?>
registro_produto\validate.php ^has php validation registro_produto\public\template.php` ^ in this file i ‘import(?)’ cdns, bootstrap,jquery,jqueryvalidate. and it’s also the header and the footer.
<div class="content">
<?php
//require validate
require_once '../validate.php';
if (!isset($tpl)) {
$tpl = '../pages/index.php';
}
include $tpl;
?> <script src="../scripts.js"></script>
</div>
` registro_produto\public\cadastro.php ^ this sets $tpl to the below page with the following code:
<?php
$tpl = '../pages/cadastro.php';
include_once 'template.php';
?>
registro_produto\pages\cadastro.php has a <h2>
tag and includes the forms:
<div class="container">
<?php include_once '../partials/form.php';
?>
</div>
registro_produto\partials\form.php:
<form method="POST" action="" class="row g-3 needs-validation" novalidate enctype="multipart/form-data">
` My problem is that i believe i’m not getting any data sent into validate.php, i’m not sure if i should set the form action to that page, this is my networks tab when i hit send with propper data