Writing Code To Identify
I need to write some special logic in my ASP.NET page. If the page is visited by a human visitor, I want to show an advertisement. If the hit is from any search engines, I do not want to show the Ad.
How can I identify if the hit is from a human visitor or search engine? Is there a server variable I can compare with the list of available search engine names?
View Replies
ADVERTISEMENT
Totalperdayleads contains 2 & totalleads contains 11. now inst_register table contains per_day_download,download_Date fields in per_Day_downlaod is initially 0 & it will be go max upto Totalperdayleads i.e.2 for one day then i have to compare date with download_Date from inst_register & again for next day 2 Totalperdayleads this way i have to allocate totalleads in per_day_downlaod field of inst_register.
View Replies
View Related
I have been asked to store text files in a DB as an OLE Object, (don't ask why just what they wanted) Anyway, I have got the files going into the DB. But now I am stuck on how to retrieve the OLE object, convert it back to usable text, and dumping it into a variable, to use in my ASP code.
I have googled response.binaryread, binarywrite, and other such keywords, but have come up with a blank of this particular problem, can anyone advise me on the correct approach to the above.
View Replies
View Related
I'm trying to write a script to countdown the number of hours and minutes until tomorrow. So far, this is what I have:
Code:
<%
response.write(dateDiff("h",now(),date+1)) & " hours and " & dateDiff("m",Time(),date+1) & " Minutes "
%>
The code above correctly displays the hours until tomorrow. but it's not displaying the minutes correctly. It's displaying the total minutes until tomorrow. If there at 4 hours left until tomorrow it's saying "4 Hours and 240 minutes."
I need it to display "4 hours and 0 minutes."
View Replies
View Related
I am trying to plot the days off employees have taken in the selected month visually using the following code. The code below takes a long time to execute typically about 8-15 secs each time. Code:
View Replies
View Related
How to identify with ASP that value is a Numeric or Date or String ?
View Replies
View Related
I have been using css to identify what link (page) the user is on by using body id. The site I am developing has alot of pages, so i am hoping this can be done easily using asp.
Here is an example of what I am after The user clicks on say Testimonials goes to the testimonials page and that link is highlighted.
View Replies
View Related
i have created an array from recordset containing user names eg. (davidp, davidp, evenf, patricka, rebeccah). which i have sorted in alphabetical order, but i need to
identify duplicates in this array and the number of times it has been duplicated.
View Replies
View Related
If I have two different kinds of users on my website say simple posters and moderators, how do I differentiate between the two on my site while they move from page to page. I mean, I cannot append the user type ids with the web address to transfer the value from page to page since anyone wold be able to alter it. If the value is accessed from the DB every time a user requests for a page, then the program will become inefficient, wouldn't it?
View Replies
View Related
We've created a video application that allows "voting" for videos, to determine prize winners. We want to restrict each computer to one vote per day. What is the best way to do this without requiring the user to log in? A login app is not in the client's budget, nor is it doable from a time standpoint. Is detecting IP address in ASP reliable for the average user? Cookies seem easiest, but they also are easy to wipe out.
View Replies
View Related
in one part of my application i have some kind of user and password form. it asks for e-mail and a costumer id (as password), the costumer id must be a number, it's an INT in the SQL table. i tried to use a javascript checking method, but this kind of checking method seems not to work at all in firefox, so i'll do the checking via asp. what i need to know is how to check if a some VAR got anything except numbers in it?
View Replies
View Related
does anyone know of a way to check if a process is running on the server... using asp ? I basically have an html form and upon submittal of the form ... i would like to redirect to the response page when a certain process is no longer running . the logic is as follows Code:
1) user enters form values and clicks submit button
2) server side asp checks the server for a process "wpuba.exe"
3) if "wpuba.exe" is not running .. redirect to page2.asp
basically I want to wait for the "wpuba.exe" process to terminate before redirecting to the response page.
View Replies
View Related
i have 2 application variables called totalAdminLoggedIn and totalUserLoggedIn
when ever an admin login, I increment the totalAdminLoggedIn value by one
and when a normal user logg in, the totalUserLoggedIn value will be incremented by one.
how can i change the values when the session expire ? i can reduce the value manually when they logoff like:
if session("userCategory")="admin" then
Application("totalAdminLoggedIn")=Application("totalAdminLoggedIN")-1
elseif session("userCategory")="user" then
Application("totalUserLoggedIn")=Application("totalUserLoggedIn")-1
end if
session.contents.remove "userCategory"
but what if the session expires automatically or if they close the window suddenly?
ie. i want to do something like below? Code:
View Replies
View Related
I am doing a webpage which allows different users from various departments to do a search/print information of people within their own department. I have a login page for user to key in the correct password and id before they enter the system. However, in order for the restriction to take place, I will have to ensure that the system recognises the person that is logged into the system.
View Replies
View Related
I'm looking for sample code that will require a use to enter a code from a scued image format.
I'm sure you've seen them before where the image is barely readable by a human and the user has to enter the code correctly to submit the form.
I'm looking for ASP code and NOT ASP.NET code as I am supporting a legacy site.
View Replies
View Related
Ok, for my company, we have two current webpages, one for general company info and one specific to a product that we market. On the 2nd page, there is a form that allows users to request a consultation from the company. When it is sent, the information is stored in an Access DB for tracking purposes.
Now, I have been requested to put this same form on the general company website. All works fine, but I can't save to the db that is stroing the info once it is submitted. Boith sites are hosted by the smae company, but they do not have (as far as I know), a shared repository for files where I could put the db.
Does anyone have any suggestions as to how I can get around this issue? What I want to do is to have the form on both sites and have the submitted data saved into the one database.
View Replies
View Related
I'm not getting error messages on this one so I don't know where to start looking. I type in my data in my form and this page should check it, add it then set a flag. Code:
View Replies
View Related
I have to perform a database query and write the results to an XML
file.
I also need to form this XML file with a DTD file.
I'd like to hear some opinions on the best way to do this.
I figured out how to write out just raw XML using adPersistXML. But
that doesn't really help as the XML needs to conform to the DTD.
I also found a way to write out the XML file line by line
using .createNode and .appendChild...but that would take forever as
the database query returns 72 columns.
View Replies
View Related
i need have a problem on line 86 of this code. Could anyone suggest problmes.
The bit in red is where i think the problem is, but may be wrong. it is where it says the problem is in the browser when i go to run it Code:
View Replies
View Related
I have the following code as a part of authenticating a system.
If Rs.eof Then
Session("Authenticated") = 0
Response.Write "Sorry, your userid or password did not match"
Response.Write "<BR>"
Response.Write "or you have not registered yet. Please register"
Response.Redirect("login.asp")
Else
Session("Authenticated") = 1
Response.Redirect ("Welcome.asp")
End If
In the first if statement, I would like to display the above messages
before forcing the login.asp page to display. Is is possible to do both
message and contents of login.asp in the same page? Thanks
View Replies
View Related
how to write PDF documents from inside
of my ASP application. I understand that there are commerical APIs , SDKs that
I can use. eg. cutePDF.
View Replies
View Related
i am having problems figuring out the syntax used when writing information to a database thru a dropdown.
i have a dropdown w/ all the months listed and i need this recorded into a database where i have already set up a column named "month".
right now all i have is html that says:
Code:
<select name="month">
<option value="January">January</option>
<option value="March">March</option>
<option value="April">April</option>
....... and so on.......
</select>
View Replies
View Related
I have an asp page that queries a database and displays a report. There is a
button on this page that I would like to dump the report into Excel. The
code behind the button:
var xl = window.open("/reportexport.asp", "_blank");
and a new window is displayed with excel. Now the problem is how do I get
the report html into this new window?
xl.document.write(window.document.body.innerHTML); is obviously not the way
since it doesn't work.
reportexport.asp contains only two lines:
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "filename=report.xls;"
View Replies
View Related
I've been having problem writing a cookie. Everything goes ok but when I
supply the .Path property to "/" It just write the cookie when there is no
cookie present, but when I try to update the cookie (or overwrite the cookie)
it doesnt change it.My requirement to supply the path to "/" because ASP.NET reads it. If I write the cookie without supplying the path, the ASP.NET pages are unable to
read the cookie.
View Replies
View Related
I have written a program where according to my query all the ouput is written to the text file. I want to add 3 lines to my text file which are needed so that it can be exported into outlook. Code:
View Replies
View Related
how can i write to a file and save to it by coding.
View Replies
View Related
We have an existing ASP app that is doing a very simple form submission to an Access db. So it opens a connection does a write and closes the connection.
The problem is that every other form submission is failing because of an "Unspecified Error" - according to our IIS web server log.
I have 2 things I'd like help with.
1) Writing to a log file:
I'd like to write to a log file (either the web servers or a different one) from the server side code within the ASP app. So, once the code opens the DB connect I would like to know it was a success. Once it writes, I want to see the string its trying to put in, etc...
How would I do this in our ASP/IIS environment?
2) Catch errors:
If I'm opening a db connection to this access db, how can I be sure the connection is a success? does a value get returned that would indicate success/failure? if so how do I capture it?
I'm speaking of some type of try-catch system.
is there another approach I should be taking to debug this problem?
View Replies
View Related
I have been playing with an idea that generates ASP files using an asp document and the file system object, so far it is doing great except one thing, when I have a chunk of text and I need to include an asp bracket ("<%" or "%>") regardless of being within the "quotation" marks the active asp document assumes it is a part of its own code and the script errors.
To get around this currently I am writing brackets like this "[<]" or "[>]" and then swapping them out of the generated ASP page using dreamweaver after creation.
The question is: Does anyone know how to represent asp brackets within a string being processed using asp??? Code:
View Replies
View Related
Im using this code to write information to a .txt file :
Dim objFSO, objTextFile
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile("C:Domainsattle-hq.comdbaction_log.txt", True)
objTextFile.WriteLine("This line is written using WriteLine().")
objTextFile.Close
Code:
View Replies
View Related
im writing an asp code to extract data textfiles from the server using FSO, but when I run the script the file were save at the server drive(c not on my local drive
View Replies
View Related
writing cookies seems to be a no brainer, but for some reason, my temporary internet folder does not contain any of the cookies when run the pages. i am starting to think that it may be IIS 4.0. anyhow, these are the cookies that i writing:
<%
Response.Cookies("userInfo") = "quiz2.asp"
Response.Cookies("userInfo").Domain = "localhost.com"
Response.Cookies("userInfo").Expires = "August 31, 2004"
Response.Cookies("userInfo").Secure = True
%>
View Replies
View Related
Can I write to a binary file from a VB script?
I get a syntax error:
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Web2_Local/custquery.asp, line 180, column 21
Open "DOWNLOAD.FIL" For Binary Access Write As #1
View Replies
View Related
I'm using the following to write a file :
filename = server.mappath(session("Directory") & "/Text/" &
ExportFileName)
Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
Set MyFile = ScriptObject.OpenTextFile(filename,2,true)
Myfile.writeline exportString
MyFile.Close
I'm putting tabs in the exportString the C way e.g. " " but they come out
in the text file literally. How does one write a tab to a file with asp? (I
don't want an HTML tab!)
View Replies
View Related