»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 09-14-2003, 04:58 PM   #1 (permalink)
Registered User
 
Join Date: Jul 2003
Location: NH
Posts: 180
atomicstomp is on a distinguished road
Send a message via AIM to atomicstomp

Should I get some kind of error that tells me what line the problem is in with ASP? Right now what I get is "The page cannot be displayed" .

__________________
((*
*))
((*
*))
atomicstomp is offline   Reply With Quote
Old 09-14-2003, 04:58 PM   #2 (permalink)
Registered User
 
Join Date: Jul 2003
Location: NH
Posts: 180
atomicstomp is on a distinguished road
Send a message via AIM to atomicstomp
By the way this is the code

<%@ language =javascript %>
<html><head><title>tip of the day</title></head><body bgcolor="#ffffff">
<center><h1>Tip of the day</h1>

<%
tips_file = "tips.txt"

// this is the absolute path
//to get the path to the current directory
//file in it (the tip_file, above).
var = abs_path = String(Request.ServerVariables("PATH_TRANSLATED")) ;

//get rid of scripts name in absolute path
//and replace w/name of the file we want to open
var file_to_open = abs_path.replace(/\\w*\.asp/,"\\") + tips_file;

fso = new ActiveXObject ("Scripting.FileSystemObject");

//Make sure we can find tips file before we get carried away
if (fso.FileExists(file_to_open)) {

//open file and read contents:
file_stream = fso.OpenTextFile(file_to_open);

tips_array = new Array ();
//loop through file and collect tips
while (! file_stream.AtEndOfStream){
line_num = file_stream.Line;
tip = file_stream.ReadLine();
tips_array[line_num-1] = tip;
}
file_stream.close();

//Generate random number based on number of tips found and print one
random_number = Math.round((tips_array.lenght-1)* Math.random());
Response.Write("<p>" + tips_array[random_number]);

}// eof if it exists

//if no file found
else {
Response.Write("<p>Sorry the tips file seems to be missing")
}
%>

</center></body></html>



And this is the .txt file Iam reading from:

1. this will be the first tip.
2. This will be the second post.
3. This is the therid of three tips.
__________________
((*
*))
((*
*))

Last edited by atomicstomp; 09-14-2003 at 06:16 PM.
atomicstomp is offline   Reply With Quote
Old 09-14-2003, 05:01 PM   #3 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
1. IE is treating you like a moron as its set to do by default.
Go into Tools --> Internet Options --> Advanced tab and KILL Show friendly HTTP Error messages

Also in IIS you can turn on debugging error messages but I wouldn't suggest it if this is a production IIS box.
(or visible tothe internet at all!)

Also check the event viewer of the IIS box and the IIS logs in the filesystem.
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Old 09-14-2003, 05:30 PM   #4 (permalink)
Registered User
 
Join Date: Jul 2003
Location: NH
Posts: 180
atomicstomp is on a distinguished road
Send a message via AIM to atomicstomp
__________________
((*
*))
((*
*))
atomicstomp is offline   Reply With Quote
Old 09-14-2003, 05:30 PM   #5 (permalink)
Registered User
 
Join Date: Jul 2003
Location: NH
Posts: 180
atomicstomp is on a distinguished road
Send a message via AIM to atomicstomp
Iam running the code from my free Brinkster.com account which is a account that I use to test code. Hows my code look?
__________________
((*
*))
((*
*))
atomicstomp is offline   Reply With Quote
Old 09-14-2003, 05:45 PM   #6 (permalink)
Registered User
 
Join Date: Jul 2003
Location: NH
Posts: 180
atomicstomp is on a distinguished road
Send a message via AIM to atomicstomp
That worked and I found the first error

var = abs_path = String(Request.ServerVariables("PATH_TRANSLATED")) ;

should be
var abs_path = String(Request.ServerVariables("PATH_TRANSLATED")) ;
__________________
((*
*))
((*
*))
atomicstomp is offline   Reply With Quote
Old 09-14-2003, 06:13 PM   #7 (permalink)
Registered User
 
Join Date: Jul 2003
Location: NH
Posts: 180
atomicstomp is on a distinguished road
Send a message via AIM to atomicstomp
Ok now I can get to this part: //if no file found
else {
Response.Write("<p>Sorry the tips file seems to be missing")
}
__________________
((*
*))
((*
*))
atomicstomp is offline   Reply With Quote
Old 09-16-2003, 09:35 AM   #8 (permalink)
Registered User
 
Join Date: Jul 2003
Location: NH
Posts: 180
atomicstomp is on a distinguished road
Send a message via AIM to atomicstomp
What if I know the file path?
__________________
((*
*))
((*
*))
atomicstomp is offline   Reply With Quote
Old 09-17-2003, 10:00 PM   #9 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
qball is on a distinguished road
you can turn script debugging ON???

winders only.
qball is offline   Reply With Quote
Old 09-19-2003, 06:59 AM   #10 (permalink)
Registered User
 
Join Date: Oct 2001
Location: Midland, NC USA
Posts: 61
UncaDanno is on a distinguished road
You're using JavaScript. Response.Write is for VBScript.

Change Response.Write (both of them) to document.write (all lowercase)

You could also use document.writeln. Makes the resulting HTML easier to read.
UncaDanno is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 12:44 AM.