submitting form data to same page...

Results 1 to 2 of 2

Thread: submitting form data to same page...

  1. #1
    Join Date
    Dec 1969

    Default submitting form data to same page...

    I want submit a form to the same page and have it do some dbase processing. How can I achieve this? I normally use Dreamweaver Ultradev which does this automatically, but this time I need to insert the data into 2 different tables and stupidly enuff, Dreamweaver can&#039;t do this.<BR><BR>thanks

  2. #2
    Join Date
    Dec 1969

    Default Why?

    Why do you want to submit to the same page???<BR><BR>I have NEVER understood this of Dreamweaver. Yeah, there are a *FEW* circumstances where that makes sense. But in general? I don&#039;t think so.<BR><BR>So some user is going to put a bunch of data on a form and submit it. And you&#039;re going to put that info into a couple tables in the DB. And then what??? Surely you aren&#039;t going to then display the same form the user just filled in, are you? Makes no sense unless this is for some data entry job that is repeated over and over. Not true of the average web site where, for example, you collect new user info.<BR><BR>No, it is much more typical that, after adding the data to the DB, you want to display a page that thanks the user for his/her input and asks what he/she wants to do next.<BR><BR>So why complicate life by trying to do all that on a single ASP page??? IT MAKES ZERO SENSE.<BR><BR>Now...<BR><BR>Having said all that...<BR><BR>How is it any different to put data into two tables than into one???<BR><BR>You get the data from the prior page the same way: <BR><BR>&#060;%<BR>userName = Request("UserName")<BR>email = Request("EMail")<BR>...<BR>%&#062;<BR><BR>And then you just construct two SQL queries instead of one:<BR><BR>&#060;%<BR>SQL = "INSERT INTO usersTable (userName, userPassword) VALUES(&#039;" & userName & "&#039;,&#039;" & password & "&#039;) "<BR>conn.Execute( SQL )<BR>SQL = "INSERT INTO loginsTable (userName, loginTime) VALUES(&#039;" & userName & "&#039;,#" & Now() & "#) "<BR>conn.Execute( SQL )<BR>%&#062;<BR><BR>See? Nothing special about the two tables.<BR><BR>And if this doesn&#039;t make enough sense to you...becuz you have gotten dependent on Dreamweaver and haven&#039;t really learned ASP...then consider getting a good book on ASP. Or, at a minimum, go run through the "Database Lessons" at<BR><BR>

Posting Permissions

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