Witam wszystkich,
Mam pewien problem, otóż jeśli wyśle formularz za który odpowiada metoda pages() to $nazwa jest tracona, a potrzebna mi jest do zapytania i nie mam pomysłu dlaczego:
<?php
public function page() {
if($_SESSION['login'] != true) {
header('Location: '.rootpatch
); }
$this->model->smarty->assign("siteTitle", "Podstrony", true);
$help = new classHelpers();
$post = $help->cleanArray($_POST);
$sql = new classMysql();
$this->setTpl('Page');
$strona = $sql->selectAsoc("SELECT `nazwa` FROM `framework_pages`");
$this->model->smarty->assign("dolisty", $strona, true);
}
public function pages() {
if($_SESSION['login'] != true) {
header('Location: '.rootpatch
); }
$this->model->smarty->assign("siteTitle", "Podstrony", true);
$help = new classHelpers();
$post = $help->cleanArray($_POST);
$sql = new classMysql();
$this->setTpl('Pages');
$nazwa = $post['nazwa'];
//traci $nazwa
$strona = $sql->selectAsoc("SELECT `nazwa`, `tresc_pl`, `tresc_en` FROM `framework_pages` WHERE `nazwa` = '$nazwa'");
$this->model->smarty->assign("dolisty", $strona, true);
if((isset($post['edytuj'])) && (!empty($post['edytuj']))) { $tresc_pl = $post['tresc_pl'];
$tresc_en = $post['tresc_en'];
$pages = $sql->insert("UPDATE `framework_pages` SET `tresc_pl` = '$tresc_pl', `tresc_en` = '$tresc_en' WHERE `nazwa` = '$nazwa'");
header('Location: '.rootpatch
.'main/tresc-podstrony'); }
}
?>