Validating data - should be an easy question

Results 1 to 3 of 3

Thread: Validating data - should be an easy question

  1. #1
    David Highlander Guest

    Default Validating data - should be an easy question

    Ok currently I already have a script written to pass data into a database. The "Form" page looks like this:<BR><BR>&#060;FORM ACTION="index3.asp" METHOD=post id=form1 name=form1&#062;<BR>First Name:<BR>&#060;INPUT NAME="firstname1" SIZE=50 MAXLENGTH=100 &#062;<BR>Last Name:<BR>&#060;INPUT NAME="lastname1" SIZE=50 MAXLENGTH=100 &#062;<BR>&#060;/form&#062;<BR><BR>This gets passed to index3.asp with the code:<BR><BR>&#060;%<BR>if not isempty(Request.Form("Submit")) then<BR> set conn = server.createobject ("adodb.connection")<BR> "client"<BR> conn.Execute "insert into clientinfo (firstname, lastname," _<BR> & "values (" _<BR> & "&#039" & Request.Form("firstname1") & "&#039, " _<BR> & "&#039" & Request.Form("lastname1") & "&#039)" <BR>end if<BR>%&#062;<BR><BR>As you can see this is nothing very difficult. Now what I want to do is use index3 to validate the data by creating DIMs and then writing out the dims. For example:<BR><BR>&#060;%<BR>Dim lastname3, firstname3<BR>lastname3 = Request.Form("lastname1")<BR>firstname3 = Request.Form("firstname1")<BR>Response.Write(first name3)<BR>Response.Write(lastname3)<BR>%&#062;<BR> <BR>Ok and then I want to pass the "validated" data into the database. So how do I edit the database entry code to accept these dims? Or will it still work the way I have it above?

  2. #2
    Zack Jones Guest

    Default RE: Validating data - should be an easy question

    Insert the Dim and response.write like you had in your post and then modify the sql like so:<BR><BR>conn.Execute "insert into clientinfo (firstname, lastname," _<BR>& "values (" _<BR>& "&#039" & firstname3 & "&#039, " _<BR>& "&#039" & lastname3 & "&#039)" <BR><BR>That should be all you&#039d have to do.<BR><BR>Take Care,<BR>Zack Jones<BR>

  3. #3
    David Highlander Guest

    Default Great - One more question...

    Um, I didn&#039t think abotu this until now but how do I pass those "DIMs" to the next page? <BR><BR>What I mean is - since forms are not involved I can&#039t have a "Submit" button - so How can I get them to pass?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts