|
|
|
|
俵ÀÌ / 2000-05-29 / ¿ÀÈÄ 2:58:07 / 203.255.3.190
Á¶È¸¼ö : 116
|
[Áú¹®] °ªÀÌ ³Ñ°ÜÁöÁö ¾Ê¾Æ¿ä |
> write.htm
> < html >
> < head >
> < title >°Ô½ÃÆÇ< /title >
>
> < script language="javascript" >
> < !javascript start--
>
> function sendit()
> {
> //À̸§
> if (document.myform.name.value == "") {
> alert("point of contact.. please.");
> return false;
> }
>
> //»óÇ°¸í
> if(document.myform.title.value == ""){
> alert("product name....please.");
> return false;
> }
> //ȸ»ç¸í
> if(document.myform.company.value == ""){
> alert("company....please.");
> return false;
> }
> //±¹°¡
> if(document.myform.country.value == ""){
> alert("country.....please.");
> return false;
> }
> //À¯È¿±â°£
> if(document.myform.vdate.value == ""){
> alert("vdate......please.");
> return false;
> {
> //´ëÇ¥ÀÚ
> if(document.myform.pregident.value ==""){
> alert("pregident....please.");
> return false;
> }
> //ºÎ¼
> if(document.myform.depart.value == ""){
> alert("department.....please.");
> return false;
> }
> //ÁÖ¼Ò
> if(document.myform.addre.value == ""){
> alert("address.....please.");
> return false;
> }
> //telephone
> if(document.myform.tel.value == ""){
> alert("telephone....please.");
> return false;
> }
> //Fax
> if(document.myform.fax.value == ""){
> alert("fax......please.");
> return false;
> }
> //ºñ¹Ð¹øÈ£
> if (document.myform.pwd.value == "" ){
> alert("password.....plase");
> return false;
> }
> document.myform.submit();
>
> }
>
> //javascript End-- >
>
> < /script >
>
> < /head >
> < body bgcolor="#ffffff" >
> -------------Áß°£»ý·«--------------
> < p >< input type="button" value="ok" OnClick="sendit()" >
> < input type="reset" value="no" name="reset" >
> < /p >
> < p >¡¡< /p >
> < /center >< /div >< /form >
> < /div >
> < /td >< /tr >< /table >
> < p > < /p >
> < /body >
> < /html >
> * write_ok.asp
> <%
> 'request °³Ã¼¸¦ ÅëÇØ ³Ñ¾î¿Â °ªµéÀ» º¯¼ö¿¡ ÀúÀåÇÑ´Ù.
> name = request("name")
> email = request("email")
> url = request("url") 'ȨÆäÀÌÁö
> title = request("title")
> company = request("company")
> country = request("country")
> vdate = request("vdate")
> mcode = request("mcode")
> pregident = request("pregident")
> depart = request("depart")
> addre = request("addre")
> tel = request("tel")
> fax = request("fax")
> pwd = request("pwd")
> content = request("content")
>
>
> set.db = server.CreateObject("ADODB.Connection")
> 'µ¥ÀÌÅͺ£À̽º ¿¬°áÀ» À§ÇÑ Connetion°³Ã¼ÀÇ ÀνºÅϽº »ý¼º
> db.Open("offer")
> 'db open(DNS)
> SQL = Select MAX(num) from myboard
> 'µ¥ÀÌÅÍ Äõ¸®¹®
> set rs = Server.CreateObject("ADODB.Recordset")
> '·¹ÄÚµå¼Â ÀνºÅϽº »ý¼º
> rs.Open SQL,db
> 'ÁöÁ¤ÇÑ Äõ¸®·Î db¿¬°á....·¹ÄÚµå¼Â °³Ã¼ °á°ú dbÀúÀå
>
> if LsNULL(rs(0)) then
> '¸¸ÀÏ ÇöÀç °¡Á®¿Â µ¥ÀÌÅÍ°¡ ÀüÇô ¾øÀ» °æ¿ì
> number = 1 'ÇöÀç ±Û ¹øÈ£¿ë º¯¼ö¿¡ 1À» ¼¼ÆÃ
> else ¸¸ÀÏ ÇöÀç °¡Á®¿Â µ¥ÀÌÅÍ°¡ ÀÖÀ» °æ¿ì´Â
> number=rs(0) + 1 '±× ¹øÈ£¿¡ +1À» Çؼ ÇöÀçÀÇ ±ÛÀÇ ³Ñ¹ö ¼¼ÆÃ
> end if
>
>
>
> SQL = "INSERT INTO myboard(name,email,url,title,company,country,vdate,mcode,pregident,depart,addre,tel,fax,pwd,content)
> SQL = SQL & " readnum,writeday,pwd)VALUES "
> SQL = SQL & "('" & name & "'"
> SQL = SQL & ",'" & email & "'"
> SQL = SQL & ",'" & url & "'"
> SQL = SQL & ",'" & title & "'"
> SQL = SQL & ",'" & company & "'"
> SQL = SQL & ",'" & country & "'"
> SQL = SQL & ",'" & vdate & "'"
> SQL = SQL & ",'" & mcode & "'"
> SQL = SQL & ",'" & pregident & "'"
> SQL = SQL & ",'" & depart & "'"
> SQL = SQL & ",'" & addre & "'"
> SQL = SQL & ",'" & tel & "'"
> SQL = SQL & ",'" & fax & "'"
> SQL = SQL & "," & number
> SQL = SQl & ",0,'" & now() & "'"
> SQL = SQL & ",'" & pwd & "')"
>
> db.execute SQL 'µ¥ÀÌÅͺ£À̽º¿¡insertÄõ¸®¸¦ º¸³» »õ·Î¿î µ¥ÀÌÅÍ ÀÔ·Â
>
>
> rs.Close
> db.Close
> Set rs = Nothing
> Set db = Nothing
>
> Response.redirect "list.asp"
>
> %>
> ÀÌ·± ¹æ½ÄÀ¸·Î Çߴµ¥ db¿¡ ÀúÀåµµ ¾ÈµÇ°í,½ºÅ©¸³Æ® ¿À·ù¶ó´Â ¸Þ¼¼Áö¸¸ °è¼Ó ³ª¿À³×¿ä.
> Âü°í·Î num,readnum:¼ýÀÚ
> writeday:³¯Â¥¸¦ Á¦¿ÜÇÏ¸é ¸ðµç°ÍÀÌ text°Åµç¿ä.
> ¾Æ¹«¸® ºÁµµ ¿¡·¯°¡ ¾ø´Â°Í °°Àºµ¥
>
>
>
-----------------------------------------------------------
½ºÅ©¸³Æ® ¿À·ù°¡ ³´Ù°í Çߴµ¥....
write.htm¿¡¼ write_ok.asp·Î ³Ñ¾î°¡Áö ¾Ê´Â°Ô ¾Æ´ÑÁö¿ä?
½ºÅ©¸³Æ® ¿À·ù¶ó¸é ¹öÆ° Ŭ¸¯½Ã¿¡ ¿¡·¯°¡ ³ª´Â°Í °°Àºµ¥...
½ºÅ©¸³Æ® ºÎºÐÀ» °íÃÄ º¸¼¼¿ä...
OnClick="sendit()"
ÀÌ ºÎºÐÀ».... form ű׷Π¿Å°Ü¼....
< form method="POST" name="myform" action="write_ok.asp" onsubmit="return sendit()" >
ÀÌ·¸°Ô Çѹø ÇØ º¸½ÃÁÒ....
|
|
|
|