READ THIS. Concerning Form... Post vs Get

Results 1 to 2 of 2

Thread: READ THIS. Concerning Form... Post vs Get

  1. #1
    Rael Guest

    Default READ THIS. Concerning Form... Post vs Get

    I have been strugling with losing part of my posts when using the get method. But when I use post in the form, I can&#039t use get, so using a url to load an asp page wont work. A url like<BR><BR>main.asp?Action=1&Product=Test<BR><BR> wont work if you are using Request.Form to get variables from your form using the post method. So... how to get around this problem... or how to support getting to your ASP file using either a GET or a POST... in stead of using Request.QueryString or Request.Form to get your variable values... make a function like so..<BR><BR>&#060;%<BR>Function GetVarValue(Var, VarName)<BR><BR> Var = Request.Form(VarName)<BR> if (Var = "") then Var = Request.QueryString(VarName)<BR> <BR> &#039I always use this just in case.<BR> Var = Replace(Var, "&#039", "&#039&#039")<BR><BR>End Function<BR>%&#062;<BR><BR>then when you want to get a value from either the post or get, you just call the function<BR><BR>&#060;%<BR>Dim FirstName<BR>Dim LastName<BR><BR>GetVarValue FirstName, "FirstName"<BR>GetVarValue LastName, "LastName"<BR>%&#062;<BR><BR>and that will solve any problems you are having... and allow you to not have to reprogram hours of work.<BR><BR>If you have any questions about what I am talking about or more specifics concerning this problem, contact me at<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: READ THIS. Concerning Form... Post vs Get

    You can also simply use:<BR><BR>Request(formVariableName)<BR><BR>That will check the .QueryString collection first; if formVariableName isn&#039t found there, it will check the .Form collection. If it isn&#039t found there, it will return "".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts