我做了一个add.php
向数据库添加一些东西的东西;之后我想搬到show.php
. 我必须发送一个 id 参数。这是我的代码:
<?php
ob_start();
session_start();
include('../../includes/connect.php');
$title = $_POST['title'];
$subject = $_POST['subject'];
$file = $_FILES['image']['tmp_name'];
$image = addslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_size = getimagesize($_FILES['image']['tmp_name']);
$query = "insert into news (title, subject, image) values ('$_POST[title]','$_POST[subject]', '$image')";
$id = mysql_insert_id();
$data = array(
'id' => $id
);
$base = '../../show.php';
$url = $base. '?' . http_build_query($data);
header("Location : $url");
exit();
?>
但是什么也没发生,我还是卡在了add.php
。