IF and using an AND command




Ok, what I am trying to do is that each page has a unique nummber on it. If (in the query string) the "agent" is on, and the number is correct, I want it to do an include. However, it fails to work, why\t



Posted On: Friday 19th of October 2012 09:40:54 PM Total Views:  189
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




if statement based on url and query string

I am working with a classic ASP website and I only know the fundamentals of programming. I am trying to display an image everywhere on my site except for one page. This page would receive a different image. By using the following code I was able to have the image change for a section of my site(site.com/page.asp) but I haven't been able to figure out how to change it for a specific page (site.com/page.aspID=123). Code ASP: I found another forum suggesting to use the following code but pasting it in the table cell I want the image to appear in broke the site. If the following code is the correct solution I am not sure how to use it. Code ASP: var url = ""; if(url == "site.com/page.aspID=123") { //Do stuff }
VIEWS ON THIS POST

218

Posted on:

Saturday 20th October 2012
View Replies!

voodoo if statement

I have a form that collects info about a contact and goes to a file that processes the information. We don't necessarily want to write the changes to the database right away though, because certain things have to be approved by someone. So for several fields, I have to determine if the submitted value is even different from the original value that's already in the database. Here's my code: If request("vchBusinessAddress1") rs("vchBusinessAddress1") Then Set rlCn = Server.CreateObject("ADODB.Connection") rlCn.Open connStr sqlStr = "INSERT INTO logChangeRequest(vchTableName, vchFieldName, vchOldValue, vchNewValue, intIdValue, datRequestDate, intRequestedBy) " sqlStr = sqlStr & "VALUES('Contacts','vchBusinessAddress1','" & REPLACE(rs("vchBusinessAddress1"),"'","''") & "','" & REPLACE(request("vchBusinessAddress1"),"'","''") & "'," sqlStr = sqlStr & request("intContactId") & ", getDate(), " & Session("intStaffId") & ")" Set rlRs = Server.CreateObject("ADODB.RecordSet") Set rlRs = rlCn.Execute(sqlStr) Set rlRs = Nothing rlCn.Close Set rlCn = Nothing difflg = 1 End If The existing value in the database is a null and the value being submitted by the form is '5 main st' (I'm in a testing phase) To verify that the values are what I think they are, I'm outputting them right before the conditional: || vs. || The output is exactly what I expect: |5 main st| vs. || So why is the conditional failing What am I missing here
VIEWS ON THIS POST

245

Posted on:

Saturday 20th October 2012
View Replies!

how to skip dynamic dependent list boxe if no data or value

I have a combo box populated from the DB. The the user selects a Region (like San Francisco), then all Subcites in that Region (like Union Square) are displayed. The user clicks on one of them and the final list with hotels is populated. Works well for region with subcites. However, sometimes the Region has no sub cities and then I can not select anything to get to the hotel list. The second box is empty. I can't figure out how to create a code so that IF there is no Subcity to THEN jump straight to the hotels. Also nice might be an option of all in Box 2. Another possibilities is to have only 2 combo boxes and if one Region has Subcities (very few do) to then pop up another box for that
VIEWS ON THIS POST

185

Posted on:

Saturday 20th October 2012
View Replies!

Identify value with ASP

Hi all. How to identify with ASP that value is a Numeric or Date or String
VIEWS ON THIS POST

101

Posted on:

Saturday 20th October 2012
View Replies!

Access files on a diffrent server/domain

Hi allOk I would like to access files that arelocated on a diffrent server/domain.The idea is that people can access there work from home which is located in there user shares any help would be greatCheers
VIEWS ON THIS POST

438

Posted on:

Sunday 21st October 2012
View Replies!

Displaying an Excel chart as a gif/jpg

Is there a way (in ASP or otherwise) that will allow me to dynamically create a gif or jpg of a chart that's in an Excel spreadsheet
VIEWS ON THIS POST

134

Posted on:

Sunday 21st October 2012
View Replies!

ASP Server status sniffing ? error handling offline server

I have an asp page that calls a page on a different server (server 2). I want to be able to write some error handling script that identifies if server 2 is down and if so displays some helpful text telling the user they cannot use the Application, this is as opposed to the browser bringing up a 401 or 403 error.Is it possible to get these error codes via asp and therfore write some handling code any ideas
VIEWS ON THIS POST

358

Posted on:

Sunday 21st October 2012
View Replies!

Using .gif with AspJpeg

I am using the AspJpeg component to resize my images. When I use .jpg images it works perfectly, but when I use a .gif image, I get a broken image.I call the image using:Here is the resize.asp page:
VIEWS ON THIS POST

137

Posted on:

Monday 22nd October 2012
View Replies!

Keeps displaying Scientific Notation

How do I stop a number from being converted to scientific notation when coming out of a database It is not in scientific notation in the database. But for some reason it displays like this 1.23456789123456E+15, when it is 15 digits it is fine just when its 16 digits does the problem develop. I have not tired convert or cast yet in my sql statement because of the way the query string is passed in the () mess it all up. Im trying to find another way before resorting to that. Is there another way to cast using ASP, html, or even something else.
VIEWS ON THIS POST

382

Posted on:

Monday 22nd October 2012
View Replies!

How do I refresh a URL in a different frame with VBScript?

I need to find out how to refresh or reload a URL i a different frame with VBScript!The functionality is the same as this JavaScript:window.parent.main.location.reload(true);
VIEWS ON THIS POST

290

Posted on:

Monday 22nd October 2012
View Replies!

datediff() vs Excel time discrepancy

When I use datediff() to find the number of days between now and Jan, 1, 1900, I'm off by roughly 2 days (and of course, whatever fraction of a day)..is there anyway I can fix this\ti.e. get the same number as Excel would give if I converted a cell with 10/10/2001 12:00:00 to a number with 5 decimal places\t
VIEWS ON THIS POST

293

Posted on:

Monday 22nd October 2012
View Replies!

iframe problem with ie5

I "may" have sorted out the problem. I think the ASP page that I was loading into the iframe was too large (I thought it would add scroll bars!!) but I have altered it a bit and one machine with IE 5 on it could now see it correctly!It anyone has IE4, IE5 or NS6 then PLEASE could you have a look for me and see if it is ok on your machine
VIEWS ON THIS POST

409

Posted on:

Monday 22nd October 2012
View Replies!

Pulling data from different dB Tables..

Can anyone point me at a good tutorial or example on pulling data from different tables in a db (Access) and combining the results in one page. I am comfortable working with one table with ASP/Access and inserting/deleting/searching etc
VIEWS ON THIS POST

329

Posted on:

Monday 22nd October 2012
View Replies!

Do not show Image if image is not availabole

\tI asked last week but I do not think I asked correctly.\tI am going to try again.\tI am trying to show an image in an area but I do not know if the image actually exists.\tI want to do an if FileExists then show file.\tI have seen the code on Msdn and either am using bad code or I do not understand it.\tSo, How do I query an Image directory to see if a specific file exists any help would be appreciated
VIEWS ON THIS POST

319

Posted on:

Monday 22nd October 2012
View Replies!

Document.LastModified

I have been trying to use the javascript "document.lastmodified" statement in my ASPs, but it displays the date and time that the ASP was actually constructed by the server!\tThat isn't what I wanted.\tI'm unaware of a server variable that shows this info....Does anyone here know a way to show the "last modified" date of an ASP
VIEWS ON THIS POST

125

Posted on:

Monday 22nd October 2012
View Replies!

Make "Surfers" key in something if they select Other...

Here is my code: using Front Page 2000 and VBScript.I have an drop down Option box that has "Where did you hear about us" selections in it. I have "Other..." at the bottom of the list."Other" is coming up more that we would like. I would like them to add where the "Other" came from in the comments section. Any Ideas in VBscript how to check the Dropdown selection after they click it and pick "Other" to pop up a Message and even put the cursor blinking in comments.TIA\t\t\tBrochure Request Form. \tPlease complete the following and receive a free brochure.\t\t\t\t First Name \tLast Name \t\t\t\t\t Company \tTitle\t\t\t\t\t\t\t\t\tAddress City \t\t\t\t\t\t State Zip \tCountry \tPhone FAX \tE-mail \tHow did you here about us \t\tChoose One...\t\tFood & Drug Magazine\t\tPackaging Digest Magazine\t\tPackagingnetwork.com\t\tPackaging World Magazine\t\tPack Expo.com\t\tThomas Register Catalog\t\tThomasregister.com\t\tReferral\t\tOther...\t\tComments:\t DougP dposton@universal1.com Ask me how Bar-codes can help you be more productive.
VIEWS ON THIS POST

260

Posted on:

Monday 22nd October 2012
View Replies!

scrollbar ASP/HTML difference

,I have the statement in an ASP-page. The problem is: Only the vertical scrollbar is displayed eventhow there is long text which should force a horizontal scrollbar to be shown.The interesting thing is: The ASP-created HTML-page saved separately and then shown in the browser directly reacts as expected: 2 scrollbars.Is there a 'scrollbar'-bug in ASP Do I have to set special header-informationDoes anyone have an explanation or better a solutionThank youKlaus
VIEWS ON THIS POST

205

Posted on:

Tuesday 23rd October 2012
View Replies!

alternate image if one doesn't exist?

Any ideas please:I have a page which displays a list of products from the database.\tFor each product I also want to display an image.\tThe images are all named based on the ProductID from the database - ie 1.gif, 2.gif etc.However, for some product IDs , there is no image.\tIn this case, I want to display a standard "No picture available" GIF.\tIs there a way in HTML to have alternate image if one isn't found\tAt the moment, I'm using ASP to see if the image exists, and if not setting the img source in ASP to the alternate image, but I'm a bit concerned about performance.\tCurrent code shown at end..
VIEWS ON THIS POST

291

Posted on:

Tuesday 23rd October 2012
View Replies!

Are there different versions of ASP?

My question seems a little odd to me even.\tI have developed an ASP page on Microsoft PWS that works perfectly.\tI have recently moved this work to a new Windows NT server.\tOn this server, almost everything works except the following script which concatantes the entries from the same field in two different records and deletes the second record if another field holds identical data for those two records.\tMy question is: is there any reason why a script would work on one server but not on anotherIf Not objRec.BOF And objRec.recordcount > 1 Then\tDim recIndex, id, author \trecIndex = 0\tWhile Not objRec.EOF\t\tid = objRec("RefID")\t\tauthor = objRec("AUTHOR")\t\tobjRec.moveprevious\t\tWhile Not objRec.BOF\t\t\tIf objRec("RefID") = id Then\t\t\t\tobjRec("AUTHOR") = objRec("AUTHOR") & " / " & author objRec.move adBookMarkFirst, recIndex objRec.delete objRec.moveprevious id = objRec("RefID") \t\t\tEnd If\t\t\tobjRec.moveprevious\t\tWEnd\t\trecindex = recindex + 1\t\tobjRec.Move adBookMarkFirst, recindex\tWEndEnd If
VIEWS ON THIS POST

252

Posted on:

Tuesday 23rd October 2012
View Replies!

Seemed Easy, Proofing Difficult

I have a Menu, on that Menu I want the User to be able to change between two accounts (Regular and Research), the accounts are unique to each User and the values simply need to be swapped. The present value is in a Session Variable. Upon the change I want the page to refresh so that other aspects of the page can change. I should mention that the Menu needs to go on every page on the website, presently 1,694. And what changes on the the page is the Footer area as it displays when the User is in the Research mode. I've tried JavaScript - but cannot move the JavaScript Variable to ASP and there is no form on the page. Code 204 and 205. Passing via to the same page, but it seems the refresh does not work when passing the same page. I thought this was going to take about 45 minutes. So far it's taken 2 days and I see no end in sight as I'm completely stuck.
VIEWS ON THIS POST

92

Posted on:

Wednesday 24th October 2012
View Replies!