PDA

View Full Version : Submit to web ASP


kaylward
11-27-2002, 07:29 PM
Anyone have a working example of an ASP submit to web that they would care to share. I'm trying to build a product activation feature. I have the database and DSN set, I'm just too tired right now to figure out the VB script code I need to match the format in the help file. All I really need is to see an ASP page used in a submit to web that writes to a database and returns a value. I can recode it to meet my needs. Thanks..

P.S. If for some reason I figure out how to do this myself, I will post my code...

kaylward
11-30-2002, 08:15 PM
This ASP page works with the Submit to Web Action (I used POST, but GET should work). The MAJOR caveat with ASP is the use of the % in the variable name. It pretty much can't be done. The problem is your fist TAG <%UserName%> uses the <% and %> which are ASP directives. No matter how I tried to encode it I could not get it to work. The good news is that the variables work without the %% around them. The problem with this script is that anywhere in your project that the word UserName appears becomes a variable. The solution I used in my project was to use a strangely worded variable then read it into a regular %% encased variable. Worked fine.

I left out all the backend processing in determining the AuthorizedToInstall value, and would add more varabiles, but that is just window dressing...

<!-- register.asp -->

<html>
<body>
<%
Name=request.querystring("Name")
AuthorizedToInstall = "TRUE"
if Name = "" then
Name = "TestUser"
end if
%>

<form>
<input type = "text" name = "Name" value = "<%= Name %>" size="20">
<input type = "submit" value = "Submit">

</form>





<SUF60>UserName,AuthorizedToInstall</SUF60>

<UserName><%= Name %></UserName>

<AuthorizedToInstall><%= AuthorizedToInstall %></AuthorizedToInstall></p>




</body>
</html>