Author |
Topic  |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 01 October 2007 : 12:08:26
|
IS there a way to request all variables being sent in .asp
I know if php you can do something like $key = >val and this will display all the values. Just wanting to do the same in .asp
Thanks
Jeff |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 01 October 2007 : 12:15:55
|
Do you mean what's being posted using a form or the server variables, etc.?
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 01 October 2007 : 12:19:25
|
Yeah its being posted via a form and I want it to display all the value names so I know all the values that are being passed.
basically I want any value that is being passed to this page to be displayed. i.e. Form Server Variables Sessions all of it.
Does this makes sense? |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 01 October 2007 : 12:25:13
|
for each field in request.form
response.write field&": "request.form(field)
next |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 01 October 2007 : 12:26:49
|
Thanks will give it a try |
 |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 01 October 2007 : 12:39:57
|
Sorry I know I am doing something really dumb but when I put this script in it gives me this error.
Expected end of statement
/forum/file_redirect.asp, line 68
response.write field&": "request.form(field)
I will be embarressed by the answer I am sure. |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 01 October 2007 : 12:46:53
|
Nope, my bad; there should be an ampersand before the request.form(field).
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 01 October 2007 : 12:52:23
|
Ok just wondering if this would be this script not working or if no values are being passed? But I get nothing displaying at all with this code:
for each field in request.form response.write field&": " & request.form(field) next |
 |
|
pdrg
Support Moderator
    
United Kingdom
2897 Posts |
Posted - 04 October 2007 : 10:35:28
|
for each field in request.form() response.write field & ": " & request.form(field) & "<br />" next
Try that - can't test it, I'm afraid, but it may help! Changes are... spaces in the response.write, plus added a BR to line wrap, and a () after the request.form in the first line - not sure if that's required in this case to return the object reference properly |
 |
|
Hamlin
Advanced Member
    
United Kingdom
2386 Posts |
Posted - 04 October 2007 : 14:27:51
|
A different approach is to just doResponse.Write Request.Form That will just dump all the values to the page. |
 |
|
JJenson
Advanced Member
    
USA
2121 Posts |
Posted - 04 October 2007 : 19:17:14
|
Sorry forgot to post back I figured out why the values were not passing back Shaggy's script worked but thanks for the other suggestions cause they are very helpful while I am trying to increase what Iknow  |
 |
|
pdrg
Support Moderator
    
United Kingdom
2897 Posts |
Posted - 05 October 2007 : 11:18:48
|
Feel the love ;-) |
 |
|
|
Topic  |
|