www.pudn.com > smartstarwap.rar > add_menu.php, change:2005-10-04,size:2343b


<? 
    /* ====================================== 
	 * ******smartstar firm wap system****** 
	 * ====================================== 
	 * AUTHOR : 
     * ======= 
     * Copyright (C) 2006 Wap-system - A wap system designed for firm 
     * by smartstar. 
	 */ 
?> 
<? 
include("function.inc.php"); 
 include("../chinese/class.Chinese.php"); 
?> 
<link href=js/common.css rel=stylesheet type=text/css> 
<? 
	 
if (isset($_GET['add'])) 
{ 
	if(!empty($_GET['sortname']) || !empty($_GET['type'])) 
	{ 
		include("../db_connect.php"); 
   $maxsortid=mysql_query("select max(sortid) from wap_newssort",$db) or die ("query failed"); 
   $maxsortid_row=mysql_fetch_row($maxsortid); 
   $sortid=$maxsortid_row[0]+1; 
   $type=$_GET['type']; 
   $type=intval($type); 
   $sortname=$_GET['sortname']; 
   	$chs_s = new Chinese("GB2312","UTF8",trim($sortname)); 
    $sortname = $chs_s->ConvertIT(); 
	mysql_query("insert into wap_newssort values('$sortid','$type','$sortname')",$db) or die ("query failed"); 
	mysql_close($db); 
     echo "<p align=center>首页菜单插入成功,3秒后自动返回菜单管理页!"; 
	echo "<script>window.setTimeout(\"location.href='admin_menu.php'\",3000);</script></p>"; 
	exit; 
	} 
	else 
	{ 
		echo "<p align=center>请把信息填写完整!"; 
		echo "<a href=\"add_menu.php\">返回</a></p>"; 
		exit; 
	} 
} 
?> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<title>添加首页菜单</title></head> 
<body> 
<table width="100%"  border="0" cellpadding="3" cellspacing="1" bgcolor="#DEDFDE"> 
<form type="get" action="add_menu.php"> 
    <tr>  
      <td colspan="2" bgcolor="#f7f7f7"><div align="center"> <strong>菜 单 添 加</strong></div></td> 
    </tr> 
	<tr>  
      <td bgcolor="#FFFFFF"><div align="center">菜单种类:</div></td> 
<td bgcolor="#FFFFFF"> 
<input type="radio" name="type" checked value="0">只单页显示一条信息 
<input type="radio" name="type" value="1">分条显示信息 
</td></tr> 
<tr>  
      <td bgcolor="#FFFFFF"> 
<div align="center">菜单名:</div></td> 
      <td bgcolor="#FFFFFF"><input type="text" name="sortname" value=""></td> 
</tr> 
<tr>  
      <td colspan="2" bgcolor="#f7f7f7"><div align="center"><input type="submit" name="add" value="提交"></div></td> 
    </tr> 
</form> 
</table> 
</body></html>