|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to get contents of a post in ASP?
I'm trying to access and iterate through POST variables. I'm thinking of something similar to PHP, where on a submit it creates a POST object, which is an associative array of all the variables.
Is ASP the same way? Is there any way to see what is in the array and have access to it's contents without knowing the contents beforehand? The reason I ask is because I have about 100 check boxes, and the user only checks a number of them - each check box is named differently. I want to, on the post page, to find out which ones were checked, short of putting an if else or select to check all 100 of them. Is there an easier way? I tried printing out the post: Response.Write(Request.Form()), and all that gave me was the querystring |
|
#2
|
|||
|
|||
|
well that's awful lazy of you, this has been answered twice within the past few days? A good thing to do before posting is searching on google, if not there try looking around the devshed postings. Both of these are viewable within the first 2 pages, let alone a search.....you need to look before posting...
http://forums.devshed.com/t80981/s.html http://forums.devshed.com/t80986/s.html |
|
#3
|
|||
|
|||
|
Is this what you are looking for......?
Code:
<%
Dim objItem ' As Variant
For Each objItem In Request.Form
Response.Write(objItem & " = " & Request.Form(objItem) & "<br>" & vbCrLf)
Next
%>
|
|
#4
|
|||
|
|||
|
thanks guys. I actually DID a search for it, but those two links you gave wasn't what I was looking for (unless I didnt read too far down in those posts). I was already doing the split thing between the = and & but that didn't seem like the best way to handle it.
Thanks WebHosts, exactly what I was looking for. |
|
#5
|
|||
|
|||
|
the links actually show you how to do it, and do work but i agree i always thought there could be another way.....
WebHosts method is much more sophisticated/coherant, i had no idea you could manipulate it that way, i'd recommend doing it his way cause i certainly will be =) |
|
#6
|
|||
|
|||
|
exactly! this is more in line with how PHP does it...which was the question I was askin ;-)
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > How to get contents of a post in ASP? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|