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

📄 addfjpr.asp

📁 标准的小型企业网站程序
💻 ASP
字号:
<html>
<head>
<title>产品管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
<link href="../css/main.css" rel="stylesheet" type="text/css">
<link href="../images/style.css" rel="stylesheet" type="text/css">
</head>
<!--#include file=conn.asp-->
<!--#include file=refuse.asp-->
<%
dim prname,errormessage,sql3,rs2,question,answer,counter
couter=0
prname=request("name")
question=request("question")
answer=request("answer")
if prname<>""then
    if  answer<>"" and question<>"" then 
     set rs2=server.createobject("adodb.recordset")
         rs2.open "select * from product where name='"&prname&"'",conn,1,1
		   if not rs2.eof and not rs2.bof then 
          sql3="insert into question(question,answer,productid)values('"&question&"','"&answer&"',"&rs2("ID")&")"
		  conn.Execute(sql3)
		  end if
    rs2.close
    
    errormessage="成功增加!"
	else errormessage="对不起,输入不能为空!"
	end if
else  errormessage="欢迎来到产品管理界面!"
end if
%>

<body>
<table width="500" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#6B8FC8">
  <!--DWLayoutTable-->
  <tr> 
    <td width="496" height="29" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr> 
          <td width="496" height="27" valign="middle" class="boxcontent"> 
            <div align="center" ><font color="red"  size="3"><%=errormessage%></font></div></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td height="236" valign="top" bgcolor="#E8F1FF"><div  align="center">
	    <form name="form1" id="form1" method="post" action="addfjpr.asp">
          <table >
            <!--DWLayoutTable-->
            <tr class="content"> 
              <td height="24" colspan="3" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
            </tr>
            <tr> 
              <td width="187" height="21">&nbsp;</td>
              <td width="95">&nbsp;</td>
              <td width="120">&nbsp;</td>
            </tr>
            <%
			set rs=server.createobject("adodb.recordset")
			rs.open "select * from product ",conn,1,1
			%>
            <tr> 
              <td class="content">请造择要添加附加问题的产品:</td>
              <td><div align="center"> 
                  <select name="name" class="option" id="name">
                    <%
				  do while not rs.eof and not rs.bof
				  %>
                    <option value="<%=rs("name")%>"><%=rs("name")%></option>
                    <%
					rs.movenext
					loop
					rs.close
					conn.close
					%>
                  </select>
                </div></td>
              <td><div align="center"> </div></td>
            </tr>
            <tr> 
              <td height="19" valign="top" class="content">
<div align="right">附加问题:</div></td>
              <td colspan="2" valign="top"><input name="question" type="text" class="INPUT" id="question" size="37"></td>
            </tr>
            <tr> 
              <td height="22" valign="top" class="content">
<div align="right">附加问题答案:</div></td>
              <td colspan="2" valign="top"><textarea name="answer" cols="30" rows="4" id="answer"></textarea></td>
            </tr>
            <tr> 
              <td height="18" valign="top"><div align="right">
                  <input name="bt2" type="submit" id="bt2" value="添加" onClick="return check();" />
                </div></td>
              <td colspan="2" valign="top">&nbsp;&nbsp; 
                <input type="reset" name="Submit" value="重置"></td>
            </tr>
            <tr> 
              <td height="34" colspan="3" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
            </tr>
            <tr> 
              <td height="40">&nbsp;</td>
              <td colspan="2">&nbsp;</td>
            </tr>
          </table>
		 
        </form>
		</div>
	</td>
  </tr>
</table>
<br>
<SCRIPT LANGUAGE="JavaScript">
<!--
function check()
{
   if(checkspace(document.form1.question.value)) {
	document.form1.question.focus();
    alert("question不能为空,请重新输入!");
	return false;
  }
   
  if(checkspace(document.form1.answer.value)) {
	document.form1.answer.focus();
    alert("answer不能为空,请重新输入!");
	return false;
  }
  
    
 }


function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
//-->
</script>
</body>
</html>

⌨️ 快捷键说明

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