[an error occurred while processing this directive] <% var pReqType=String(Request("reqtype")); %> Add entry to Addressbook
Make your own free website on Tripod.com
<% var pRequests={ pFirstName: String(Request("fname")), // Requests stored in pLastName: String(Request("lname")), // an Object Array or Collection pEmailAddress: String(Request("pEmail")), // for easy navigation pPhoneNumber: String(Request("pNumber")), pNickName: String(Request("nick")), pAddress: String(Request("address")) }; for(var i in pRequests){ pRequests[i]=pRequests[i].replace(/'/g,"''"); // Avoid SQL bad character ERROR pRequests[i]=pRequests[i].replace(/\|/g,""); } if(pReqType=="ins"){ pConn=Server.CreateObject("adodb.connection"); pConn.open(db); pSql=""; pSql="INSERT INTO pAddressTable(first_name,last_name,phone,email,nick_name,address)" +""+" VALUES('"+pRequests['pFirstName']+"'," +"'"+pRequests['pLastName']+"'," +"'"+pRequests['pPhoneNumber']+"'," +"'"+pRequests['pEmailAddress']+"'," +"'"+pRequests['pNickName']+"'," +"'"+pRequests['pAddress']+"')" pConn.execute(pSql); pConn.close(); pConn=null; pSql=""; Response.write("

 <\/p>\n

 <\/p>"); Response.write(showMessage("New address added","A record inserted wi" +"th name : "+pRequests["pFirstName"]+"" +" "+pRequests["pLastName"]+"

Click here to a" +"dd another
Or
Go to home page")); Response.write("<\/body>\n"); Response.End(); } %>


pAddress book >> insert new Address
Home

 

Add Entry
First Name
Last Name
Phone Number
Email Address
Nick Name   (without spaces)
Address