⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edit.php

📁 需要mysql
💻 PHP
字号:
<?php
	if(!$inc_lib)  { include("lib.inc.php"); }
	if(!$inc_condb)  { include("conn_db.inc.php"); }

	session_start();
	session_register("s_admin_user_name");
	session_register("s_admin_pass_word");
	
	if( ($s_admin_user_name!=$admin_name) or ($s_admin_pass_word!=$admin_pass))
	{ 
		header("Location:login.htm\n\n");
		exit;
	}

	
	$user_id=1;//缺省处理
	if(intval($g_id)<1) { 	fatalerror("错误,请选择一个留言,无法编辑."); }
	$thissql="select * from $db_gb where g_id=$g_id and user_id=$user_id";
	$query=mysql_query($thissql,$db_conn);
	$array=mysql_fetch_array($query);
	if(!$array[0])
	{
		fatalerror("错误,此条留言不存在,无法编辑.");
	}
	$l_user_name=htmlspecialchars($array[user_name]);
	$l_user_url=htmlspecialchars($array[user_url]);	
	$l_user_email=htmlspecialchars($array[user_email]);	
	$l_g_title=htmlspecialchars($array[g_title]);
	$l_g_said=htmlspecialchars($array[g_said]);
?>
<html>
<head>
<meta HTTP-EQUIV=Content-Type content="text/html; charset=gb2312">
<title><? echo $gb_title; ?></title>
<link rel="stylesheet" href="nr.css" type="text/css">
</head>
<body>
<table width=95% height=4 border=0><tr><td>&nbsp;</td></tr></table>
      <div align="center">
      <center>
      <table border="0" cellpadding="4" cellspacing="1" width="95%" align=center class=hz>
      <tr  BGCOLOR=#E3E3E3>
      <td  BGCOLOR='#5D7790'>&nbsp;<b><font color=white>编辑留言:</b> <?echo $array[g_title];?></font></td>
      </tr>
      </table>
      <table border="0" cellpadding="4" cellspacing="1" width="95%" align=center  BGCOLOR=#F7F7F7 class=hz>
    <form method="POST" action=admined.php>
      <tr  bgcolor=#E3E3E3>
      <td width="131">&nbsp;姓名</td>
      <td width="544"><input type="text" name="user_name" size="25" maxlength=30 value="<?echo $l_user_name?>"> <font color=red>*</font> </td>
      </tr>
      <tr  bgcolor=#E3E3E3>
      <td width="131">&nbsp;主页</td>
      <td width="544"><input type="text" name="user_url" size="25" maxlength=100 value="<?echo $l_user_url?>"></td>
      </tr>
      <tr  bgcolor=#E3E3E3>
      <td width="131">&nbsp;邮件</td>
      <td width="544"><input type="text" name="user_email" size="25" maxlength=80 value="<?echo $l_user_email?>"></td>
      </tr>
      <tr  bgcolor=#E3E3E3>
      <td width="131">&nbsp;标题</td>
      <td width="544"><input type="text" name="g_title" size="25" maxlength=30 value="<?echo $l_g_title; ?>"> <font color=red>*</font> </td>
      </tr>
      <tr  bgcolor=#E3E3E3>
      <td valign="top" width="131">&nbsp;内容</td>
      <td width="544"><textarea rows="6" name="g_said" cols="40"><?echo $l_g_said;?></textarea> </td>
      </tr>
      </table>
      </center>
      </div>
      <p align="center"><input type=hidden name=g_id value="<?echo $g_id;?>"><input type="submit" value=" 修改留言 " name="doedit" class=btnStyle>&nbsp;&nbsp;&nbsp; <input type="reset" value=" 复原 " name="B2"  class=btnStyle></p>
      </form>
</body>
</html>      

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -