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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to?

Status
Not open for further replies.

ABJ

Technical User
Aug 29, 2000
16
AU
I have built a page where you type a number and it adds .htm and you are take to the page - i already have a 404 on my web site so what i would like to do if some types the wrong number in it is taken to a page which then refreshes its self to default page.
Thanks for any help
Al
 
If I understand what you're trying to do correctly, at first glance it seems like this is something more properly handled on the server side (by either web server configuration -- i.e. customized 404 pages or some kind of server side scripting scheme).

How do you know that they typed the "wrong" number in? Does wrong mean that the page doesn't exist?

The only thing that occurs to me you could do on the client side is put the acceptable pages in a structure (like an array) and compare what the client types in against the array's contents, sending him/her to the default page if there is no match. However, this alone becomes problematic if there are a large number of correct entries and/or the entries change frequently.

A slightly better solution would be to generate the initial page from a CGI script that would use a scheme (like simply reading all the files in a directory that represent acceptable entries) for generating the array. Or even better, creating a list box or combo box and putting the entries into that, so the client can just choose one of the correct entries.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top