我想在preview.php
中顯示$new_client
變量,但我沒有得到任何值,如果我將任何其他變量設置爲klmn
會話,那麼它工作正常。哪裏不對?
pdf/index.php
<?php
session_start();
if(!isset($_SERVER['HTTP_REFERER'])){
header('location:../error.php');
exit;
};
include("add_client.php");
$_SESSION['klnm']=$new_client;
echo $_SESSION['klnm'];
pdf/add_client.php
<?php
if(!isset($_SERVER['HTTP_REFERER'])){
header('location:../error.php');
exit;
};
require("../config.php");
$new_client = strtolower($_POST['new-offer']);
$_SESSION['klnm']=$new_client;
pdf/preview.php
<?php
session_start();
$klient = $_SESSION['klnm'];
echo $_SESSION['klnm'];
我的形式kokpit/index.php文件
<form method="post" action="../PDF/index.php">
<input type="text" name="new-offer">
<button type="submit">Wygeneruj</button>
</form>
您是否檢查過'$ _POST ['new-offer']'的值,您是否向'index.php'發出了POST請求? – jeroen
你能告訴我們你的表單嗎? –
它在索引中顯示正常,但它在preview.php中損壞我不明白爲什麼 – michal