我想在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