I have a 'primary' intranet website and a 'secondary' backup of this site as
well. I would like to programmatically have the effect that if the
primary site is (page not found 404) not available, for it to access the
secondary site or at least be able to add a message with (or instead of) the
404 error dialog that the primary site is down and give the user a link to
the alternative (secondary) site.
i was hoping to include a 'page direct' function into this if-then statement below. I want the user who is logged into the session to be directed automatically to the purchase.asp page. I know the goto statement is wrong here. Any suggestions on what I should be using unstead?
<% if session("name") <> "" then goto "purchase.asp" else response.write "You must log in to buy views.<p>" end if %>
I am using server side javascipt and want to do a redirect to another asp page passing parameter values using the POST method. This redirect needs to occur if an else statement in my code is reached. I need to have a function which does this redirect to the other asp page, passing the parameters via POST.
can i directly mail to hotmail or yahoo acount with any asp.net code.
i have an example like above but i need smtp adress for hotmail, i tried it for smtp.mail.yahoo.com but it didnt work and "authentication required" error accured
I have an asp page which basically takes some data from a previous page form and inserts the data to my database and then does a re-direct to:
Response.Redirect "JS_Create.asp"
On this page is just an animated logo saying something like 'Loading Data ....'
On this asp page JS_Create.asp I have another re-direct handled by a timer to go to JobSheet.asp.
The idea is that the user enters data into the form, if the form is validated correctly, they are transferred to the next page which tells them the data is loading. They are held there for say 3 to 5 seconds and then transferred to the final page JobSheet.asp.
The code I have on JS_Create.asp for the timed re-direct is: Code:
I have a web site in asp where I do not want the users to directly type in the URL of some pages in the browser. For e.g. the main page is 'index.asp' and depending on the users resolution either 'mypage1024.asp' or page 'my800.asp' would open up in the browser. What I want is that no user should be able to directly access the page by typing in the URL www.mysite.com/page1024.asp or www.mysite.com/800.asp. If a user tries to access these pages directly then they should be forcefully redirected to the home page www.mysite.com/index.asp and this page would check the resolution and load the 'mypage1024.asp' or 'mypage800.asp' depending
I have used ASP to force a user to log on to a page prior to allowing them to see a page including images. However, once a person knows the URL to the image on its own a person can type in that full URL and see the image, without being logged in.
For example, password login required to get to: http://www.mydomain.com/showmypics.asp
But, you can navigate straight to: http://www.mydomain.com/pictures/mypicture.jpg
how to prevent a user going to the picture directly?
This means that the content in the div tag when larger than the div height has a scroll bar at the side to view all the projects. Once the projects area displayed there is a image at the end of each row that when clicked goes to the db and pull back reports for that project. This is all done by passing vars in the querystring pulling info from the db and writing out the appropriate code. Code:
i have uploaded my files and now it comes up with a 500 error message. what i did was when i started bulding the site i used dreamveaver and its dsn connection and its features but now i need to change the dsn connection on the relevant pages to direct connection and i am very very confused how i will do this and as an amature i need help. to start of my default.asp uses dsn conection can you show me all the sections i need to change.i have attached a txt file that contains all the code in my default.asp page.
I ám looking for print function in ASP and/or Javascript which can print without pop up the page just as desktop application did. so when you click the print button it will directly print without open a page.
I have a ton of dynamic pages that I need an asp conditional to run on.I know the urls of all the pages and I want to know if there is an easy way to write a conditional statement that if they are on a specific page that it outputs something depending on the url they are on. Is there an easy way to do this?
I have the following simple conditional on my page,
If EmpIDError <> 1 Then 'Show Input items End If
Now I need to add another conditional to this,
If PosIDError <> 1 Then 'Show input items End If
So I made it like this,
If EmpIDError <> 1 OR PosIDError <> 1 Then
But the problem is that if PosIDError = 1, then it still shows the input items. But if I take the EmpIDError <> 1 out then it works with no problems. Why would this be like this?
I have a page that logs the user in (the code will be below). When they log in correctly, or even incorrectly, they get directed to default.asp. The login is working correctly however because when I log in with a false name and password I cannot proceed to checkout. How can i direct the user (ONCE they are signed in correctly) to a customer page(custpage.asp) instead of my homepage(default.asp)? Code:
Basically I have something that needs to be installed in the htdocs in order for me to use it - however i need to be able to access something thats in the private dir on the same dir.
Dirs go like /whateverftp/ /whateverftp/private/ /whateverftp/htdocs/
obv Const DB_FOLDER_PATH = "/whateverftp/private/" wouldn't work, what would I put in there in order to gain access to the private dir?
If you have a directory of pdf files, how can you prevent someone from typing in www.yoursite/pdf_folder/some_file.pdf and getting that file? You could write a login script but if they know the path to the pdf, they could get it. I want to prevent people from doing this.
I have a code for executing a stored procedure and returning a recordset wrapped in an IF statement. If the statement is true the code executes. If the statement is false the code is skipped.
On the page, I want to display a message if the Recordset returned from the stored procedure is empty.
<% If rs.BOF or rs.EOF Then %>
Message
<% End If %>
Running the above code will return an error message if the recordset object doesn't exist...i.e. if the stored procedure hasn't executed and returned the recordset object.
How can I write the code to include that condition?
i have an simple invoice sheet and in "total" coloumn i need to put a formula like IF < 8.50 THEN VALUE =8.50.it is something like we dont do delivery less then 8.50 so if the TOTAL is less than 8.50 then it should turn in to 8.50 automatically.
One of my asp pages can be loaded in two ways - it may be submitted to itself (and therefore contains user data) or it can be loaded by clicking on a link on my menu, and consequently all fields are empty.
If the fields contain values (ie. the submit button was pressed), i want to load data from my database into an array, but if it is accessed via a link, i don't want this data to be loaded. So essentially, i want to know if there is some form of conditional compilation or something in asp (i know it technically shouldn't be called that, but i'm coming from a c++ background, so...) similar to the #if and #elif type directives in C
I can't place the code in a subprogram and selectively call it, because I want the arrays to be global so all my client-side scripts can access the data I'm using VBScript for the asp scripting.
I have a shopping cart that I want to load items in that come from a huge scrolling form. In other words, when someone clicks on a category in our site, it scrolls out all the items in that category, maybe 30 or more. I have text boxes next to each item so somone can enter a number, then press submit form button at the bottom of the form, and send those slections to the shopping cart.
The problem is, many of the text boxes are empty, yet they are still being sent to the shopping cart as a quatity of 0. Is there a way for sql to ignore a value if the variable is zero, or only get the sql statement to run if a variable is > 0?
I have an email containing link say (somelink.asp) A user clicks on this link (say from outlook). because this user is not logged into the site, the request goes to somelink/login.asp.
The user then logs in. After successful login I would like to take this user to the link he clicked on originally. Is this possible without having to pass the lionk url as part of the query string?
Is there a way where I can prevent people from downloading a file using a direct link (or bookmarked) (i.e. http://www.myfile.com/file.csv)? I want my user to log in with their email address so I can keep track of who downloads my files and when.
I already wrote a filedownload.asp file already which tracks and logs users who downloads the file. But I made a mistake in giving out the direct links to people already. So now people are using that direct link which bypasses filedownload.asp file. If there are any techniques on doing this.
I am not too sure wats wrong w the if-else statement below!
<%if(grp==grp2)%> { <%if (start==req || end==req)%> { <%=grp%> <%=start%> <%=end%> } <%else%> { <%="There is no such record found"%> } } <%else%> { <%="There is no such record found!"%> } <%endif%>
URLURLI need help writiing an advanced conditional statement.I want to display an image if two recordset values = 1 or other various number combinations.
This statement works with one, how could I edit this statement to include two recordsets values? Say I want to add another feild say "recent" to this statement and it has a value of 2
Code:
<% if Recordset1.Fields.Item("progress").Value = 1 then ' Adv Conditional Region %> <% end if ' Recordset1.Fields.Item("progress").Value = 1 %>
I'm just trying to figure out what the colon : does in this code:
<%If (Not isNull(COLOR)) Then If (COLOR = "Blue") Then Response.Write("SELECTED") : Response.Write("")
I thought it may be the ASP version of the Ternary operator, but it doesn't have the same effect. Is it just another way to concatenate? or a reverse concatenate? or maybe a addition of an empty string to make sure that the output from the response.write statement is a string and not a number?
If the second response statement has a value then it prints it e.g. Code: