我的jQuery代码是:
$.post('action/edit_breakdown.php', {id: id,program: program,st_name: st_name,p_name: p_name,fob_name: fob_name,track_no: track_no,date: date,currency: currency,image_name: image_name},
function(data){
$("#message").html(data);
//$("#editBreakdown").attr('disabled','disabled');
$("#message").hide();
$("#message").fadeIn(1500); //Fade in the data given by the insert.php file
/*$('#editBreakdown').each(function(){
setTimeout(function() { window.location.reload(true); }, 2000);
});*/
});
要插入记录,我使用了操作页面,例如:
<?php
require_once("../config/dbConnect.php");
$image_name=$_FILES['image_name']['name'];
$tmpName=$_FILES['image_name']['tmp_name'];
if($image_name)
{
/*$photo=$_FILES['photo']['name'];
$tmpName=$_FILES['photo']['tmp_name'];*/
$ext=substr(strchr($image_name,"."),1);
$rand = mt_rand(100000, 999999);
$image_name=$rand.".".$ext;
$filePath="pictures/".$photo;
//echo "this is ".$filePath;
$result=move_uploaded_file($tmpName,"../".$filePath);
thumbnail("../pictures", "../pictures","$image_name",200,$ext);
}
echo $BreakdownUpdate = "UPDATE breakdowns SET image='$filePath' WHERE id='$id'";
$query = mysql_query($BreakdownUpdate) or die(mysql_error());
if($query)
{
echo "<div class='oMsg1 oMsgError1'>Breakdown successfully Updated </div>";
}
else
{
echo "<div class='oMsg oMsgError'>Breakdown Update failed,Try again </div>";
}
?>
我的问题是,这段代码在下面显示错误:
未定义索引:第 1 行 C:\xampp\htdocs\marchand\action\edit_breakdown.php 中的 image_name
我怎么解决这个问题??