<% 'The Two functions below were developed by Robert Collyer:- ASPwiz@hotmail.com ' 'The First Function-'ReadFormVariables' can be used in place of the very common:- 'var1=request.form("var1") 'var2=request.form("var2") 'var3=request.form("var3") 'var4=request.form("var4") 'var5=request.form("var5") '....etc 'You simply now just call the function, and all vbscript values are set to match those 'posted from a form. This sounds great, and it is but the vbscript variables are named 'identically to the form variable names (this is usually a good thing) 'If for example a form contained a text box that is named 'Surname', 'and after submitting the form, the following page called upon the 'ReadFormVariables' 'function, VBScript would now have access to a variable called Surname containing the value 'of whatever the user entered into the textbox. It will loop through ALL form variables, 'setting the VBScript equivelents. ' 'The Second Function-'SendHiddenFormFields' is very useful for those occasions where 'you need to read in all the form values, and include them within another form as 'hidden fields. Reasons to this could include multiple page forms and also when a user 'enters data incorrectly on a form, and you want to post the data back for editing, etc ' 'Please email ASPwiz@hotmail.com with all feedback. 'I do not require a mention if you use this code (Unless the source is published), it 'is supplied purely because 'I know how much of a pain in the arse the long way round is and I feel sorry for those 'who are non-the-wiser. Please feel free to distribute this as far and as wide as you like. 'This message will self destruct, etc...... Sub SendHiddenFormFields () For Each Field In Request.Form TheString="" & vbcrlf Response.Write TheString Next END Sub Sub ReadFormVariables() For Each Field In Request.Form TheString = Field & "=Request.Form(""" & Field & """)" If eval(TheString) Then 'Tests to see the string is valid ASP/VBScript syntax Execute(TheString)'Executes the command contained in the string(This will set all VBScript variables) Else Response.Write "Internal Error (ReadFormVariables Function)" 'The above line will catch any freak errors. It's never been called yet, and I suppose it's probabaly needless. End if Next END Sub %>