Php位置标头-变量

问题描述

我需要一些有关使用变量的标头位置的帮助。 我丢失了变量。

如何保留我的$ var?

    $var = $_GET['valueToSearch']
    (I get the correct value here)

if(isset($_POST['shipping']))
header("Location: shipping.php?valueToSearch=".$var);
exit;
}

这需要我送货,但我失去了$ var的价值。

if(isset($_POST['shipping']))
$var = 'C2234';
header("Location: shipping.php?valueToSearch=".$var);
exit;
}

这正常工作。

如何保留$ var或其他任何建议?

我也尝试过:

window.location = "shipping.php?valueToSearch=" + $var;

谢谢

- More detail:

<?php
$var = $_GET['valueToSearch']; 
$query = "SELECT increment_id,status,created_at,method,shipping_description,company,name,telephone,email,suburb,state,country,data_transf_ordervalue_incl,DATE_FORMAT(created_at,'%b %y')AS date FROM tblorder WHERE increment_id = '$var' order by created_at DESC";
    require_once('/../../private/dbcon_order.php');
    $result = mysqli_query($connect,$query) or die ('Error');
    $row_cnt = mysqli_num_rows($result);

if(isset($_POST['shipping']))
{
header("Location: shipping.php?valueToSearch=".$var);
exit;


解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)