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

ASP only works sometimes. What did I do wrong?

Status
Not open for further replies.

MrKovacic

IS-IT--Management
Nov 5, 2002
213
0
0
US
First, refer to this thread for the background info:


The hosting server is FreeBSD and has FP server extensions installed. The pages that are not working are:

(Page I made to test the ASP)
SourceCode:
Code:
<html>
<head>
<title>My First ASP Page</title>
</head>
<body bgcolor="white" text="black">
<%
'Dimension variables
Dim strMessage

'Place the value Hello World into the variable strMessage
strMessage = "Hello World"

'Write the contents of the variable strMessage to the web page 
Response.Write (strMessage)

'Write line break into the web page
Response.Write ("<br>")

'Write the server time on the web page using the VBScript Time() function
Response.Write ("The time on the server is: " & Time())

'Close the server script
%> 
</body>
</html>

Another page is
SourceCode:
Code:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>We</title>
</head>

<body>

<p><!--webbot bot="PurpleText"
Preview="Guest Book - Use this page to collect the reactions of visitors to your web site. All of the comments submitted by users will go to a different page, 'guestlog.htm' by default, which is then included below. If you want to use a different file to capture comments, change the File Name selected in the Form Properties dialog and in the Page URL of the Include component below the form."
-->
</p>
<hr>
<p>We'd like to know what you think about our web site. Please leave your
comments in this public guest book so we can share your thoughts with other
visitors.</p>
<form action="--WEBBOT-SELF--" method="POST">
  <!--webbot bot="SaveDatabase" startspan SuggestedExt="asp"
  S-DataConnection="new_page_1" S-RecordSource="Results"
  S-Builtin-Fields="REMOTE_HOST HTTP_USER_AGENT Timestamp REMOTE_USER"
  S-Builtin-DBFields="Remote_computer_name Browser_type Timestamp User_name"
  S-Form-Fields="Comments" S-Form-DBFields="Comments"
  U-ASP-Include-Url="_fpclass/fpdbform.inc" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="_fpclass/fpdbform.inc"--><!--webbot
  bot="SaveDatabase" endspan -->
  <h2><strong>Add Your Comments</strong></h2>
  <p><textarea name="Comments" rows="8" cols="52"></textarea></p>
  <p><input type="submit" value="Submit Comments"> <input type="reset" value="Clear Comments"><br>
  <br>
  <em>After you submit your comments, you will need to reload this page with
  your browser in order to see your additions to the log.</em></p>
</form>
<!--webbot bot="Include" TAG="BODY" U-INCLUDE="guestlog.htm" -->
<hr>
<h5>Author information goes here.<br>
Copyright © 1999 by [OrganizationName]. All rights reserved.<br>
Revised: <!--webbot bot="TimeStamp" S-TYPE="Edited"
S-FORMAT="%d %b %Y %H:%M:%S %Z" -->
.</h5><%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
On Error Resume Next

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
	Err.Clear

	Set fp_conn =  Server.CreateObject("ADODB.Connection")
	FP_DumpError strErrorUrl, "Cannot create connection"

	Set fp_rs = Server.CreateObject("ADODB.Recordset")
	FP_DumpError strErrorUrl, "Cannot create record set"

	fp_conn.Open Application("new_page_1_ConnectionString")
	FP_DumpError strErrorUrl, "Cannot open database"

	fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
	FP_DumpError strErrorUrl, "Cannot open record set"

	fp_rs.AddNew
	FP_DumpError strErrorUrl, "Cannot add new record set to the database"
	Dim arFormFields0(1)
	Dim arFormDBFields0(1)

	arFormFields0(0) = "Comments"
	arFormDBFields0(0) = "Comments"

	FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0

	If Request.ServerVariables("REMOTE_HOST") <> "" Then
		FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"), "Remote_computer_name"
	End If
	If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
		FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"), "Browser_type"
	End If
	FP_SaveFieldToDB fp_rs, Now, "Timestamp"
	If Request.ServerVariables("REMOTE_USER") <> "" Then
		FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"), "User_name"
	End If

	fp_rs.Update
	FP_DumpError strErrorUrl, "Cannot update the database"

	fp_rs.Close
	fp_conn.Close

	FP_FormConfirmation "text/html; charset=windows-1252",_
						"Form Confirmation",_
						"Thank you for submitting the following information:",_
						"addcoments.asp",_
						"Return to the form."

End If
End If

%>


</body>

</html>

Thank you!!!

Mike Kovacic

&quot;&quot;&quot; &quot;&quot;&quot;
(o) (O)
\____/
 
Well, FP extensions does not mean it can run ASP unfortunately.

Your site is running on a Unix box which doesn't appear to have one of the ASP clones running, so you won't be able to run ASP pages.

If you View | Souce in IE you can see your asp code, which means the page has not been processed.
 
Additionally, the more usual response is experienced with the second page - the server can't process it and offers it for downloading.
 
Damn.

Thank you though, no one else could point that out. I though my coding was just wrong.

Thank you!!

Thank you!!!

Mike Kovacic

&quot;&quot;&quot; &quot;&quot;&quot;
(o) (O)
\____/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top