我正在做一个小项目,现在我面临保存问题。当我在文本编辑器上键入内容并单击保存按钮(用于保存在数据库中)时,它什么也不回复。
这是过程代码:
case "Publish":
$fileName=$_FILES["image"]["name"];
if($fileName)
{
$filePath="images/news_img/".$fileName;
if(file_exists($filePath))
{
$a=gmdate("Yzhis");
move_uploaded_file($_FILES["image"]["tmp_name"], "images/news_img/".$a.$_FILES["image"]["name"]);
$fileName=$a.$_FILES["image"]["name"];
}
else
{
move_uploaded_file($_FILES["image"]["tmp_name"], "images/news_img/".$_FILES["image"]["name"]);
}
}
if($arttitle=="" || $date=="" || $category=="" || $status=="" )
{
$_SESSION['error_msg']="You Must Fill All The Required fileds";
$go="add_articles.php";
}
else
{
/*for username check*/
$checksql=mysql_query("select * from articles where arttitle='$arttitle'");
$checkdata=mysql_fetch_array($checksql);
if($checkdata['arttitle']!=$arttitle)
{
$inssql=mysql_query("INSERT INTO articles VALUES(NULL,'$arttitle','$date','$category','$status','$fileName','$articale',0)");
}
else
{
$_SESSION['username_msg']="Articale Name Already Exists.";
}
}
$go="add_articles.php";
break;
case"Edit":
$updatesql=mysql_query("UPDATE articles SET
arttitle='$arttitle',date='$date',category='$category',status='$status',articale='$articale' where aid = '$hiddenid'");
$_SESSION['success_msg']="Update Successful!";
$go="add_articles.php";
break;