<?php
$con = mysqli_connect("***********************");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$querytype = mysqli_real_escape_string($con, $_POST['querytype']);
$criteria = mysqli_real_escape_string($con, $_POST['criteria']);
$query= mysqli_query($con,"SELECT trackingnumber FROM 'OrderDB' WHERE '$querytype' = '$criteria'");
$result = mysqli_fetch_array ($query);
header('Location: http://trackyourpackage.uk/track.php?oid=' . $result);
?>
答案 0 :(得分:0)
$result = mysqli_fetch_array ($query); header('Location: http://trackyourpackage.uk/track.php?oid=' . $result);
mysql_fetch_array()
返回一个数组。将数组转换为字符串会生成文字字符串"Array"
。您需要使用数组索引:
header('Location: http://trackyourpackage.uk/track.php?oid=' . $result[0]);