Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Challenge: I need to open a message window...

Status
Not open for further replies.

JavaJedi

Programmer
May 24, 2002
12
US
I need to open a new error message window when the form I am running requests a ".pdf" file that is not in my "/pdf" directory.

My form opens a ".pdf" file based on the model number the user enters. If the model number is not valid, I want to open my own customized window instead of the HTML error window that my server opens when a page is not found.....

So far I have not been able to find ANYONE who can do this. Please help, you will be my savior. Thanks in advance...
 
Otherwise you could try this

(although I'd go with Tony's idea)

If your trying to check if a .pdf file based on modelNumber.pdf exists then try this in an asp file -

dim extension = ".pdf"
dim file, model
Set FileSys = Server.CreateObject("Scripting.FileSystemObject")

' Set Physical Path
physicalPath = "c:\Your Path\pdf\"

' Get Model Number
model = resquest("YourModelNumber")

' Concatenate
file = physicalPath & model & extension

' Check file exists
If fileSys.FileExists(file) = false Then
Response.write(&quot;<script>alert('No such file Exists')</script>&quot;)
else
'if file exists then
End If

Mark
 
if you are using Apache you can do this as well!!

I recommend finding a way to no send people to unexistant pages in the first place. Could you find a way to do it like that? Gary Haran
 
I've never tried writing an .ASP page. How different is it from setting up an HTML page?
 
it's a little different - it took me about 5 days to build a site and that was using asp in 21 days and a lot of help from friends, plus that was just the basics...

if you haven't tried it before, I'd go with Tony and Gary's sugguestion of setting a default message if a page isn't found.

I can't give much help on that as I'm not sure myself how to do it, how do you do guys?

Mark

 
ASP stands for Active Server Page. It's a bit harder to set up than HTML but not by much. However ASP only runs on Microsoft products IIS, PWS and eventually it will cost you money if you need to make your web site accept much traffic.

PHP (Pre Hypertext Processor) is free and is easier to learn than ASP (that is my opinion). It also runs on IIS (MS Internet Information Server which costs money), Apache as well as many other web servers.

You can download PHP triad to try PHP out if you want! :) Gary Haran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top