插入代码
view plaincopy <?
$action=$_GET['action'];
switch($action){
//添加记录
case"add";
$mail = trim(htmlspecialchars($_POST["mail"]));
$username = trim(htmlspecialchars($_POST["username"]));
$tel = trim(htmlspecialchars($_POST["tel"]));
$fax = trim(htmlspecialchars($_POST["fax"]));
$company = trim(htmlspecialchars($_POST["company"]));
$address = trim(htmlspecialchars($_POST["address"])); $sql="insert into crm_company (mail,username,tel,fax,company,address,addtime) values ('$mail','$username','$tel','$fax','$company','$address','$addtime')";
//echo $sql;
print "<mce:script type="text/javascript"><!-- location.href='c_companylist.PHP'; // --></mce:script>";//*/
}?>
编辑代码
view plaincopy
<?
$action=$_GET['action'];
switch($action){
//添加记录
case"edit";
$uid = trim(htmlspecialchars($_POST["uid"]));
$regtime = trim(htmlspecialchars($_POST["regtime"]));
$deadline = trim(htmlspecialchars($_POST["deadline"]));
$item = trim(htmlspecialchars($_POST["item2"]));
$price = trim(htmlspecialchars($_POST["price"]));
$product = trim(htmlspecialchars($_POST["product"]));
$content = trim(htmlspecialchars($_POST["content"]));
$sql="update crm_info set uid='$uid',regtime='$regtime',deadline='$deadline',item='$item',price='$price',product='$product',content='$content' where id='$id'";
//echo $sql;
print "<mce:script type="text/javascript"><!--
location.href='c_infolist.PHP'; // --></mce:script>";//*/
}?>
<form id="form1" name="form1" method="post" action="?action=edit&id=<?PHP echo $rs['id'];?>" onSubmit="return checkadd()">
</form>
[xhtml] view plaincopy <a href="?action=del&id=<? echo $rs['id'];?>" οnclick="return confirm('确定删除?')">删除</a> <?
$action=$_GET['action'];
switch($action){
//删除记录
case"del";
$id=$_GET['id'];
$sql="delete from crm_info where id='$id'";
print "<mce:script type="text/javascript"><!-- location.href='c_infolist.PHP'; // --></mce:script>";
break;
}
?>
转载于:https://www.cnblogs.com/bwzhangtao/p/4233346.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。