就是这样,我还必须建立它会将图片上传到服务器,但它出现的错误导致无法继续或该说什么?唔
activate.php她
<input type="file" name="file" />
activate_updater.php她
<?php include ("include/database/db.php");
ini_set('display_errors',1);
error_reporting(E_ALL | E_STRICT);
session_start();
$pb = null;
include("class.upload.php");
$handle = new Upload($_FILES['profilbillede']);
if($handle->uploaded){
//lidt mere store billeder
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = 220;
$handle->Process("profil/store");
//til profil billede lign..
$handle->image_resize = true;
$handle->image_ratio_crop = true;
$handle->image_y = 75;
$handle->image_x = 75;
$handle->Process("profil");
$pb = $handle->file_dst_name;
echo 'Billedet: '.$pb.'<br>';
echo "Dit billede blev upload<br>";
}else{
$pb = 'bruger_intet.png';
}
if($stmt = $mysqli->prepare('UPDATE `brugere` SET `rank`=2, `katogori`=?, `djnavn`=?, `profilbillede`=?, `profiltekst`=?, `facebook`=?, `pris`=?, `booking`=?, `mobil`=? WHERE `code`=?'))
{
$stmt->bind_param('iiiiiiiis', $katogori, $djnavn, $profilbillede, $profiltekst, $facebook, $pris, $booking, $mobil, $g_code);
//fra input ting ting..
$katogori = $_POST["kategori"];
$djnavn = $_POST["djnavn"];
$profilbillede = $_POST["file"];
$profiltekst = $_POST["profiltekst"];
$facebook = $_POST["facebook"];
$pris = $_POST["pris"];
$booking = $_POST["booking"];
$mobil = $_POST["mobil"];
$g_code = $_SESSION["code"];
$stmt->execute();
$stmt->close();
header("Location: http://.....dk/logind/");
}
else
{
echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error;
}
?>
所以这里出现了错误?
注意:未定义的索引:第 37 行 /home/jesperbo/public_html/,,,.dk/activate_updater.php 中的文件
警告:无法修改标头信息 - 标头已由 /home/jesperbo/public_html/,,.dk/activate_updater.php 中的(输出开始于 /home/jesperbo/public_html/,,,.dk/activate_updater.php:24)发送在第 48 行
问题来了
$profilbillede = $_POST["file"];
和这里
echo 'Billedet: '.$pb.'<br>';
和这里
header("Location: http://....dk/logind/");