Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 7th, 2007, 08:43 PM
Dr_Rock's Avatar
Dr_Rock Dr_Rock is offline
Wizard Down Under
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Location: Australia
Posts: 250 Dr_Rock User rank is Captain (20000 - 30000 Reputation Level)Dr_Rock User rank is Captain (20000 - 30000 Reputation Level)Dr_Rock User rank is Captain (20000 - 30000 Reputation Level)Dr_Rock User rank is Captain (20000 - 30000 Reputation Level)Dr_Rock User rank is Captain (20000 - 30000 Reputation Level)Dr_Rock User rank is Captain (20000 - 30000 Reputation Level)Dr_Rock User rank is Captain (20000 - 30000 Reputation Level)Dr_Rock User rank is Captain (20000 - 30000 Reputation Level)Dr_Rock User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Days 4 h 4 m 16 sec
Reputation Power: 211
Send a message via MSN to Dr_Rock Send a message via Yahoo to Dr_Rock
Thumbs up Update database via dynamically created form

Just a little script I wrote for an aspfree user, currently set to work without a database but move a few comment indicators and your good to go!

Code:
<html>
<title>Give Dr_Rock lots of rep</title>
<body bgcolor="#FFFFFF">
<%
Dim strSQL, strVariableValue, bulFirstEntry, intCounter
If Request("submit") <> "" Then
bulFirstEntry = true
strSQL = "Update this_table Set this_field = desired_value where"
for each variable_name in request.form

	If request.form(variable_name) = "1" then
		'strip "select" and leaves us with the db row unique id
		variable_value=Replace(variable_name  , "select", "")
		if bulFirstEntry then
			strSQL = strSQL & " id =" & variable_value
			bulFirstEntry = false
		else
			strSQL = strSQL & " or id =" & variable_value & " "		
		end if
	End If

next
response.write(strSQL)
Else
response.write("no good")
End If
%>
<form action="<%= request.servervariables("script_name") %>" method="post">
<% 

'Do Until rs.EOF 
for intCounter=1 to 10
%>
<input type="checkbox" name="select<% Response.write(intCounter) 'rs("id") %>" value="1">Row <% Response.write(intCounter) 'rs("id") %><br>
<% 
next
'	rs.MoveNext
'Loop
%>
<input type="submit" name="submit" value="Submit">
</form> 
</body>
</html>

Reply With Quote
  #2  
Old February 7th, 2007, 08:46 PM
jmurrayhead's Avatar
jmurrayhead jmurrayhead is offline
The Drunken Moderator
ASP Free God 17th Plane (13000 - 13499 posts)
 
Join Date: Feb 2004
Location: Reston, VA, USA
Posts: 13,062 jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)jmurrayhead User rank is General 9th Grade (Above 100000 Reputation Level)  Folding Points: 82293 Folding Title: Advanced FolderFolding Points: 82293 Folding Title: Advanced FolderFolding Points: 82293 Folding Title: Advanced FolderFolding Points: 82293 Folding Title: Advanced FolderFolding Points: 82293 Folding Title: Advanced Folder
Time spent in forums: 3 Months 6 Days 13 h 36 m 58 sec
Reputation Power: 1576
Facebook
thanks, but this belongs in the code bank.
__________________
jmurrayhead

Did I help you out? Make me popular by clicking the icon!

New Members:Proper way to post a question

Powered by ASP.Net

Reply With Quote
  #3  
Old February 7th, 2007, 08:59 PM
Lafinboy's Avatar
Lafinboy Lafinboy is offline
The Laughing Moderator
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 3,263 Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)Lafinboy User rank is Sergeant (500 - 2000 Reputation Level)  Folding Points: 29199 Folding Title: Starter FolderFolding Points: 29199 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 1 Day 10 h 35 m 51 sec
Reputation Power: 15
Send a message via ICQ to Lafinboy Send a message via AIM to Lafinboy Send a message via MSN to Lafinboy Send a message via Yahoo to Lafinboy Send a message via Skype to Lafinboy
Moved to Code Bank

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Update database via dynamically created form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway