![]() |
|
|
+ Search |
![]()
|
Jul 17th, 2000 05:05
unknown unknown, Keith Willis
Use this for an example...
<%@ language=vbscript %>
<%
'check to see if the form was submitted.
if Request("chkr") <> "" then
'put some checking in here to make sure you have what you want.
strSQL = "Put your SQL Here With all of your parameters"
set conn = server.createobject("ADODB.Connection")
conn.open Dsn=yourDSN,username,password
set rs = conn.execute(strSQL)
response.redirect "thankyou.htm"
end if
%>
<html>
<head>
<\head>
<body>
<form action=thispage.asp method=post>
<input type=hidden name=chkr id=chkr value=1>
<!-- Put your other form stuff here -->
<input type=submit value=submit name=mysubmit id=mysubmit>
</form>
</body>
</html>
The basis behind this is simple. The chkr hidden field is going to
contain a value only after the form has been submitted. So if you first
load the page, the chkr value has not been submitted so it is empty
resulting in the server script not being executed inside of the if
statement.
© 1999-2004 Synop Pty Ltd