Originally posted by DonChris
you mean print_r outputs the correct data while in the included file
include('forms/insert/hooldaja/hooldusleping.insert.form.php');
$_POST is empty??
That's exactly whats happening!
variables don't get lost by includes - something
strange is happening 🙂
explain the structure of data-transfer from
the form to the different scripts
When I hit submit, the following actions take place.
index.php:
switch ((int)$page) { // Start switch
// PÄRINGUD
case 1:
require('query_menu.php');
break;
// SISESTAMINE
case 2:
if($_SESSION['tase'] == 'admin') {
require('submit_menu.html');
} else {
require('menu.html');
}
break;
// KASUTAJAD
case 3:
if($_SESSION['tase'] == 'admin') {
require('users_menu.html');
} else {
require('menu.html');
}
break;
// MUUTMINE
case 4:
if($_SESSION['tase'] == 'admin') {
require('update_menu.html');
} else {
require('menu.html');
}
break;
// ADMINI MENÜÜ
default:
if($_SESSION['tase'] == 'admin') {
require('menu_admin.html');
} else {
require('menu.html');
}
} // End switch
// Choose the query to display
switch ((int)$category) {
case 1:
require('queries/ruum.query.php'); // Päringud ruumi kohta
break;
case 2:
require('queries/personal.query.php'); // Päringud personali kohta
break;
case 3:
require('queries/rentnik.query.php'); // Päringud rentnike kohta
break;
case 4:
require('queries/hooldaja.query.php'); // Päringud hooldajate kohta
break;
case 5:
require('queries/dokument.query.php'); // Päringud dokumentide kohta
break;
case 10:
require('queries/users.query.php'); // Päringud kasutajate kohta
break;
default:
}
Category 4 includes that form:
switch ((int)$query) {
case 2:
print_r($_POST);
include('forms/insert/hooldaja/hooldusleping.insert.form.php');
break;
}
Now as I mentioned above the form itself contains print_r($_POST); too before if ($submit) check.
First array is filled, other is empty...