ASP Equivalent Of CFParam - Setting A Value Of A Form Variable
I'd like to do something similar to CFParam, but in ASP - basically, I have a form variable ("Type") which may or may not be passed from the referring page. Some referring pages have an input field called "Type", whilst others do not.
I'm actually a CF developer, but keen to learn ASP. My current code at the top of the script is : Code:
select contactname,contactnumber,contactnumber1,contactem ail,address,city,state ,zip,type,sqft,0,bedrooms,baths,lotsize,acreage,ga rage,comments,price,0, 0,county from table1 where active='Y'
I need HASPHOTO to equal 1 if hasphoto <> 0 and HASPHOTO=0 when hasphoto=0. Make sense? HASPHOTO usually equals a number, but in this case, I want it to equal a 1 or 0 because I am exporting this to a CSV file. I know how to do everything else, just not this part.
I know that you can do : Request.ServerVariables("QUERY_STRING") but can you actually set a serverVariable? I know that sounds counter intuitive , but is it possible, via vbscipt/asp?
I have an ASP application that has been running for 5 years that I am now modifying. Since then, I have installed asp.net 1.1 and 2.0 on my xp pro box. Whenever I run the "login" code for the app, it crashes as my dllhost goes to 98% cpu. I have traced the code to this line:
Session("SCHUserID")=123
What is strange is if I set the value to 11 or lower, this does not fail. What is also strange is if I set Session("SCH1UserID")= 123 it works. I know this has to have something to do with running asp.net on this box as well. I have tried running the app in its own process (High) and creating it's own virtual directory with no luck.
I'm trying to calculate the total time using values from database I run a select statement to find the timein column in my database.
Now how do i assign the result to a variable so that it can be used? There is only going to be one result because i'm checking it against an autonumber field. that is used as time 1. Code:
I'm trying to use CDO with ASP. How do I set the value the user types in to be a variable that I can use?One specific of this is I want to have a text input for the user's email address. The value the user types in will be stored as a variable (hopefully, if this is possible). I assume it would be something like this:Code:
So I figured maybe it was something to do with the script tags so I tried using the <% %> tags instead and I got an error saying something like Microsoft VBScript runtime object required.
I have a screen, screenA, from which I call another screen, screenB, with a form on it. ScreenA has an ID that is captured in a variable called strShortName. (That variable is defined in another file called into ScreenA via an include.) I want to write that name as the value in a hidden field in the form on screenB. How can I do that?
I have a form with several fields - I have a radio button Yes/No
I have Field1, Field2, Field3, Field4 and Field5
If the radio button is Yes then I want Field1, Field2 and Field3 to be required - the other fields do not have to be required.
I'm not sure how to set them to be required - I know that I would have an if statement that if the button was yes then do something, but I'm not sure what to do?
Have a school project in which I have to use an ASP page to process data from a form submitted by a user. Have to do this 3 ways - Using a Function, a Sub Procedure, and a Class. Simple enough.
I decided to see if I could get them all to work from 1 submittal page using an option group of radio buttons, and JavaScripting to send me to the correct page (just as a personal learning experience). Got this working also - but only in IE. Code:
I have a form that you enter in a file path i.e c:folder1 you then click search and the application will search for that folder and check if it exists if so it will return a list of files in that folder. you are alowed to select what files you want to copie and then enter in the folder you want to copie them to.
here is my issues: i enter in my folder to search on and it is good I get a list of files in that folder I am also given the the folder path at the top of my table. in the code I have also created a hidden field so that when I click on my copy button my from folder path is sent over to that I can us it in my objFile.CopyFile.
NOW Here is where I go *WTF* at the top of my page I am printing out my folder path vartiable and it is right. however once i press that copy button the folder name gets cut off at the space i.e E:flkfkdlsdkklfile2 inforil....
so how do I fix this here is my code I have tryed to highlight the partst pertaing to this issue. Code:
next response.write(myVariable) The problem with that is that response.write(myVariable) only prints the last field in the form.
I know that if I move the response.write(myVariable) INSIDE of the loop it will print correctly but I am not trying to print the form fields BUT I AM TRYING to store them in ONE variable.
I am posting a form variable to an ASP script, but when the asp script receives the variable, I don't want it to open a new web page or open in the same window. I also can't have the script on the same page and refresh the page.
I use javascript to submit the form with the hidden field, and I want the variable to be processed by the asp script in the background on the server and return nothing. So essentially, i want the script to run transparently. How can I do this with asp? We run a classic environment.
I am doing this because the script is a tracking script, and it's disruptive for the user to see any trace of it. I want them to continue surfing as normal.
so far it works fine. It shows the value in the text box on the page. I am trying to post this page with all the form fields to a new page that emails all the variables that are on this page. The form tag looks like
In orderform3.asp, i am requesting the values for all the form fields as follows before emailing all the fields to myself:
strBody = strBody & Request.Form("Account_Name") 'strbody is the variable that adds all the form fields to the body of the email strBody = strBody & vbCrLf strBody = strBody & Request.Form("Contact_Name") strBody = strBody & vbCrLf strBody = strBody & Request.Form("Template")
Here is the problem...I am getting the email with the values filled in except for "Template" and I cannot figure out why. Is there something that I am doing wrong? i have to mention that there is no DB behind this site...it is just a static web site with an email script in it.
I have a Function in VB Script that generates a signature. I assign the result to a variable and then need to do a hidden post to an ASP Page for further processing.
Basic functionality is I have a button upon pressing it -- It does the hidden post.
Code looks like this. Please assist with passing this stringToSign variable to the .asp page via hidden post. Code:
I have a form that on clicking of the Update button first updates the specific record in the db, then Inserts if the vMemo field is not empty. The problem that I'm having is that After updating if you hit the [F5] key (refresh) it inserts another record ...
I have tried:
1. Clearing the vMemo field after the insert is done (vMemo = "") 2. Setting the value on the form for this field to ""
Neither of these are working. It's not displaying it on the screen but it is holding it in memory (I guess). Any way to clear this out after update/insert?
I am using a new payment gateway for one of my sites. One of the options they recommend for submitting the credit card info involves submitting a form in "the background" with a post. They then return a comma-delimited string, which I can easily parse and act upon.
How do I submit a form in the background? I'm sure it's simple, I just never had to do it so I never learned how...
if i have a vbscript function on a certain form and I assigned some values on an array variable on that function, is there a way for me to retrieve the values of that array on another asp page once i submitted the form?
I have a page that calls itself using a form. The form has two select elements. In the sql statement I am attempting to match the values of the select element to populate a recordset.
The two fields in teh Access db are of type Text and of type Integer. What baffles me is that one sql statement works fine and the other returns nothing. I am having the issue matching on the bedrooms.
In the first statement I took out all other doo-doo and just matched bedrooms = request("bedrooms"). On the other one I used p.bedrooms but it keeps turning up empty. Code:
We have piece of hardware that can post xml data via post, A clocking in machine to be exact. The data that it posts is raw and without headers so when I use the PHP (on apache) system variable $HTTP_RAW_POST_DATA all I see is the XML and CRLF's. As the server I need to use this on does not have PHP, I need to use ASP.
I have tried using ALL_RAW and ALL_HTTP with IIS and ASP but cannot get any data out. If I create a form and post some data to the same script I get what I would expect (the field name= then the data). Is there any equivalent to the $HTTP_RAW_POST_DATA in ASP or do I have to enable something to get this data out (there is a flag in php.ini to turn this on).
I'm used to working with PHP, but have a project that requires me to use ASP. The project is almost finished, but I have one problem that needs to be rectified. In PHP you can use the NL2BR fundtion to ensure that the line breaks are formatted correctly when viewed on the page.Is there a ASP equivalent? If so, how exactly would it be utilised with a server behaviour like this?Code: