Passing variables to asp from <INPUT>

Results 1 to 2 of 2

Thread: Passing variables to asp from <INPUT>

  1. #1
    Join Date
    Dec 1969

    Default Passing variables to asp from <INPUT>

    There is a minor typo or something I don&#039;t understand about passing variables in asp. <BR><BR>The asp code below has a problem with a variable I am trying to pass to it from the previous page using an &#060;Input type="hidden" name="SupplierID&#039; value="27346"&#062; If I take out the Response.Write(SupplierID) in the asp code it works. <BR><BR>&#060;% <BR><BR>Dim upl, NewFileName <BR> <BR>Set upl = Server.CreateObject("ASPSimpleUpload.Upload") <BR>If Len(upl.Form("File1")) &#062; 0 Then <BR> NewFileName = "/Suppliers/images/" & Response.Write(SupplierID) & "-" & upl.ExtractFileName(upl.Form("File1")) <BR> If upl.SaveToWeb("File1", NewFileName) Then <BR> Response.Write("File successfully written to disk.") <BR> Else <BR> Response.Write("Error saving the file.") <BR> End If <BR>End If <BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Passing variables to asp from <INPUT>

    I&#039;m pretty sure this is just a mix of syntax. The response.write is unnecessary, try this:<BR><BR>&#039;previous code<BR>NewFileName = "/Suppliers/images/" & SupplierID & "-" &<BR>&#039;more code<BR><BR>This is assuming that you stored the value of<BR>request("SupplierID") in the variable &#039;SupplierID&#039;. Otherwise you can do it right when you define &#039;NewFileName&#039;<BR><BR>&#039;previous code<BR>NewFileName = "/Suppliers/images/" & request("SupplierID") & "-" &<BR>&#039;more code<BR><BR>Hope this helps you<BR><BR>Thank you come again!

Posting Permissions

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