<% imei=format(Request.Form("imei")) model=format(Request.Form("model")) price=format(Request.Form("price")) model1=format(Request.Form("model1")) model2=format(Request.Form("model2")) supplier=format(Request.Form("supplier")) If model="" then model=trim(model1&" "&model2) End If ' Function that eliminates singles "'" and spaces in input strings ' And some other things to avoid SQL injection attacks Function format(st) dim stnew stnew = st stnew = Replace(stnew,"'","''") stnew = Replace(stnew,"""","") stnew = Replace(stnew,"--","") stnew = Replace(stnew,"DELETE","") stnew = Replace(stnew,"UPDATE","") stnew = Replace(stnew,"DROP","") stnew = Replace(stnew,"SELECT","") stnew = Replace(stnew,"INSERT","") stnew = Server.HTMLEncode(stnew) format = Trim(stnew) End Function ' Function that converts to universal format yyyy/mm/dd Function dbDate(dt) dbDate = year(dt) &"/"& right("0" & month(dt), 2) &_ "/"& right("0" & day(dt),2) End Function Set connection = Server.CreateObject("ADODB.Connection") connection.Open("stock") SQL="INSERT INTO Product(IMEI,Model,Date_in,Price,Supplier) VALUES ('"&imei&"','"&model&"',#"&dbDate(date)&" "& time &"#,'"&price&"','"&supplier&"');" connection.Execute(SQL) %> Cellular Advice NI LTD

New Product

Success. Data was included correctly in the database.


Click here to add another product of the same model

 

 

 

©2005 Cellular Advice NI LTD

e-REdING. Biblioteca de la Escuela Superior de Ingenieros de Sevilla.


SISTEMA DE INFORMACIÓN INTEGRAL PARA EMPRESAS APLICANDO TECNOLOGÍAS DE INFORMACIÓN Y VPNS

: Salvago Hidalgo, Raúl
: Ingeniería Telecomunicación
Contenido del proyecto: