ASP Insert - Sample ASP Files Insert (Part 1) Motes Notes...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Sample ASP Files – Insert (Part 1) Mote’s Notes 4/18/2011 Insert1A.asp This sample ASP application allows the user to provide the necessary information for a new paycheck: CheckNumber (primary key), PayDate, EID (foreign key), GrossAmount and NetAmount. The user's information is passed to the second ASP script where it is converted into the appropriate INSERT command (i.e., action command) for the backend database. This simplistic version of the paycheck example has absolutely no data validation. There is an excellent chance it will blow up when used by mere mortals (aka, everyone). That's not good. We should never trust the dumb luck of the mortals.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Insert1A.asp <html> <head> <title>Insert 1A</title> <link rel=stylesheet type='text/css' href='MyStyle.css'> </head> <body> <% Response.Write("<h2>Insert 1A: New Paycheck (Blind Faith Version)</h2>") ' Begin input form Response.Write("<form action='Insert1A-Step2.asp' method='post'>") ' Display input fields Response.Write("<table border=0>") Response.Write("<tr>") Response.Write("<th align='left'>Check Number</th>") Response.Write("<td align='left'><input type='text' name='CheckNumber' style='width:100px'></td>") Response.Write("</tr>") Response.Write("<tr>") Response.Write("<th align='left'>Date</th>") Response.Write("<td align='left'><input type='text' name='PayDate' style='width:100px'></td>") Response.Write("</tr>") Response.Write("<tr>") Response.Write("<th align='left'>EID</th>") Response.Write("<td align='left'><input type='text' name='EID' style='width:100px'></td>") Response.Write("</tr>") Response.Write("<tr>") Response.Write("<th align='left'>Gross Amount</th>") Response.Write("<td align='left'><input type='text' name='GrossAmount' style='width:100px'></td>") Response.Write("</tr>") Response.Write("<tr>") Response.Write("<th align='left'>Net Amount</th>") Response.Write("<td align='left'><input type='text' name='NetAmount' style='width:100px'></td>") Response.Write("</tr>") Response.Write("<tr>") Response.Write("<td></td>") Response.Write("<td align='left'><input type='submit' value='Insert' style='width:100px'></td>") Response.Write("</tr>") Response.Write("</table>") ' End input form Response.Write("</form>") %> </body> </html>
Background image of page 2
3 Insert1A-Step2.asp <html> <head> <title>Insert 1A</title> <link rel=stylesheet type='text/css' href='MyStyle.css'> </head> <!--#include file="MyInfo.asp" --> <!--#include file="MyLibrary.asp" --> <body> <% Response.Write("<h2>Insert 1A: New Paycheck (Blind Faith Version)</h2>") ' Fetch user input from previous page SelectedCheckNumber=CleanNumber(Request.Form("CheckNumber"))
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

ASP Insert - Sample ASP Files Insert (Part 1) Motes Notes...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online