解决方案 »
- 附件上传并显示的问题
- 那位高手给优化下,谢谢
- ■■■■大家帮忙看看这个生成压缩文件的类如何调用?
- 急招PHP高手
- 为什么照抄都不行(distinct)
- 在用select时,如果搜索字母a,会搜索出汉字来,如何解决?
- 在 foreach 循环里面,不能够 使用 eval,有什么办法可以解决?
- 为什么我的apache+php是下载???
- 一个关于首页的新闻的问题啊。100分求解啊!!!
- 我在申请的空间上传了phpmyadmin,配置完后,运行显示:CGI/PHP程序错误: 该脚本不允许执行!请问这怎么办? (祥情请进)
- 为何会无限循环
- 虎年大吉,88分,谁给提供一个php webservice soap 发送xml的例子?
if和else中执行的语句完全相同。不清楚你要做什么。
$title=$_REQUEST["title"];
$create_type=$_REQUEST["create_type"];
$content=$_REQUEST["content"];
$type1=$_REQUEST["create_news_type"];
if(isset($_REQUEST["post"]) && $_REQUEST["post"]=="create_news" && $type1=="WZ")
{
$sql="insert into admin_manager_artice(`a_id`,`a_title`,`a_content`,`a_type`,`a_date`) values(null,'{$title}','{$content}','{$create_type}',now());";
mysql_query($sql) or die('query_error');
}else{
$sql1="insert into admin_manager_notice(`n_id`,`n_title`,`n_content`,`n_type`,`n_date`) values(null,'{$title}','{$content}','{$create_type}',now());";
mysql_query($sql1) or die('query error');
}
?>
$title=$_REQUEST["title"];
$create_type=$_REQUEST["create_type"];
$content=$_REQUEST["content"];
$type1=$_REQUEST["create_news_type"]; 分别var_dump()这四个变量,输出每条SQL语句,看是什么。
还有一个错误就是这个else,我还没提交表单它就执行了,并返回or die的错误提示,请帮我看下吧
else{
$sql1="insert into admin_manager_notice(`n_id`,`n_title`,`n_content`,`n_type`,`n_date`) values(null,'{$title}','{$content}','{$create_type}',now());";
mysql_query($sql1) or die('query error');
}
是不是应该再设置一个变量,加载页面不执行IF-ELSE,当提交的时候才执行?
$sql1="insert into admin_manager_notice(`n_id`,`n_title`,`n_content`,`n_type`,`n_date`) values(null,'{$title}','{$content}','{$create_type}',now());";
mysql_query($sql1) or die('query error');
echo "success";
}