Write a news system in DB-1

Source: Internet
Author: User

Write a news system using the DB class today (click to view the DB class)
Add news main code

<Form action = "news_add_up.asp? Tabname = news "onSubmit =" return isok (this) "method =" post "name =" upload "id =" upload "> <table width =" 100% "border =" 0 "class =" df "> <tr> <td> <div align = "right"> title: </div> </td> <div align = "left"> <input name = "Title" type = "text" id = "Title" size = "80 "> </div> </td> </tr> <td> <div align =" right "> time: </div> </td> <div align = "left"> <input name = "time" type = "text" id = "time" value = "< % = date () %> "> </div> </td> </tr> <td> <div align =" right "> author: </div> </td> <div align = "left"> <input name = "Author" type = "text" id = "Author"> </div> </td> </tr> <td> <div align = "right"> No: </div> </td> <div align = "left"> <input name = "list" type = "text" id = "list" value = "0 "size =" 10 "> </div> </td> </tr> <td> <div align =" right "> content: </div> </td> <div align = "left"> <textarea name = "Content" cols = "75" rows = "25" id = "Content "> </textarea> </div> </td> </tr> <td> <div align =" right "> </div> </td> <td> <div align = "left"> <input name = "formSubmit" type = "submit" id = "formSubmit" value = "submit"> <input type = "reset "name =" Submit2 "value =" reset "> </div> </td> </tr> <td> & nbsp; </td> <td> & nbsp; </td> </tr> </table> </form>

Note: The input name is the same as the database name. If you do not want the added database to include form in the name. For example, formSubmit

News_add_up.asp main code

<! -- # Include file = "db. asp "--> <% server_back = Request. serverVariables ("HTTP_REFERER") set mydb = new dbid = request. queryString ("id") tabname = request. queryString ("tabname") mydb. addEditRS tabname, id mydb. closeresponse. write "<script language = JavaScript>" & chr (13) & "alert ('Operation successful !!! '); "& Chr (13) &" location. href =' "& server_back &" '; "&" </script> "%>

 

In this way, you can add news! The modification is no longer written. It is similar to this action = "news_add_up.asp? Tabname = news & id = id ", mainly to make the input name and the field name in the table the same line ~!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.