Member_2_6492660_1
asked on
Web Site Development Help ASP Page does not display
Running IIS 6 on Windows 2003 R2 Standard SP3
Have a web site that works fine.
I have many pages written is ASP and they all work fine.
It is one of those it was working and now it is not.
NO changes to the asp code.
The Server was rebuilt a while back onto a new server box.
I copied the folders from the original server.
Only one page does not display. No Error message just a blank screen.
The Home Page has a hyper link to a sign guestbook
That's presents guestbook.htm
on the guestbook.htm page a hyperlink to guestbook.asp which is suppose to display the contents of the guestbook.
I can also get at it by
example www.mydomain.com\guestbook.asp
GUESTBOOK.HTM
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Name</title>
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/zero/zero101 1.css"><me ta name="Microsoft Theme" content="zero 1011, default">
</head>
<body>
<a href=guestbook.asp>See guestbook</a><p>
<FORM ACTION="guestbook.asp" METHOD=post>
Your name<br>
<input type=text name=visitorsname size=25><br>
Your email<br>
<input type=text name=visitorsemail size=25><br>
Your message<br>
<textarea name=visitorsmessage rows=4 Cols=80>
</textarea><BR>
<img id="imgCaptcha" src="captcha.asp" /><br /><a href="javascript:void(0)" onclick="RefreshImage('img Captcha')" >Change Image</a> <BR>
<input type=text name=captchacode size=25><br>
<BR>
<INPUT TYPE=submit value="Post">
</FORM>
</html>
guestbook.asp
<%
function TestCaptcha(byval valSession, byval valCaptcha)
dim tmpSession
valSession = Trim(valSession)
valCaptcha = Trim(valCaptcha)
if (valSession = vbNullString) or (valCaptcha = vbNullString) then
TestCaptcha = false
else
tmpSession = valSession
valSession = Trim(Session(valSession))
Session(tmpSession) = vbNullString
if valSession = vbNullString then
TestCaptcha = false
else
valCaptcha = Replace(valCaptcha,"i","I" )
if StrComp(valSession,valCapt cha,1) = 0 then
TestCaptcha = true
else
TestCaptcha = false
end if
end if
end if
end function
%>
<%
Set fs = CreateObject("Scripting.Fi leSystemOb ject")
Folderpath=server.mappath( "\") & "/cgi-bin/guestbook"
Wcounter=Folderpath &"/counter.txt"
if request.form<>"" then
if TestCaptcha("ASPCAPTCHA", Request.Form("captchacode" )) then
Wemail = Request.Form("visitorsemai l")
test1=instr(Wemail, "@") ' value must be >1
test2=instr(Wemail, ".") ' value must be >4
test3=len(Wemail) ' value must be >6
test4=InStr (test1,Wemail,".",1) ' value must be >test1+2
if test1<2 OR test2<5 OR test3<7 OR test4<test1+3 then
response.write(Wemail & " is not a valid email address<p>")
email_Test=0
else
email_Test=1
end if
if email_Test=1 then
Set fs = CreateObject("Scripting.Fi leSystemOb ject")
if fs.FolderExists(Folderpath ) then
Set a = fs.OpenTextFile(Wcounter)
counter = Clng(a.ReadLine)
counter = counter + 1
a.close
else
Set a = fs.CreateFolder(Folderpath )
counter=1
end if
Set a = fs.CreateTextFile(Wcounter ,True)
a.WriteLine(counter)
a.Close
Set fs=nothing
Set fs = CreateObject("Scripting.Fi leSystemOb ject")
Set a = fs.CreateTextFile(Folderpa th & "\" & counter & ".txt")
a.WriteLine("<b><a HREF=mailto:" & Request.Form("visitorsemai l") & ">" & Request.Form("visitorsname ") & "</a></b>")
a.WriteLine(Request.Form(" visitorsme ssage"))
a.Close
Set a=nothing
Set fs=nothing
end if
else
Response.Write("<b style=""color:#FF0000"">Yo u entered the wrong code.</b>")
end if
end if
%>
Have a web site that works fine.
I have many pages written is ASP and they all work fine.
It is one of those it was working and now it is not.
NO changes to the asp code.
The Server was rebuilt a while back onto a new server box.
I copied the folders from the original server.
Only one page does not display. No Error message just a blank screen.
The Home Page has a hyper link to a sign guestbook
That's presents guestbook.htm
on the guestbook.htm page a hyperlink to guestbook.asp which is suppose to display the contents of the guestbook.
I can also get at it by
example www.mydomain.com\guestbook.asp
GUESTBOOK.HTM
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Name</title>
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/zero/zero101
</head>
<body>
<a href=guestbook.asp>See guestbook</a><p>
<FORM ACTION="guestbook.asp" METHOD=post>
Your name<br>
<input type=text name=visitorsname size=25><br>
Your email<br>
<input type=text name=visitorsemail size=25><br>
Your message<br>
<textarea name=visitorsmessage rows=4 Cols=80>
</textarea><BR>
<img id="imgCaptcha" src="captcha.asp" /><br /><a href="javascript:void(0)" onclick="RefreshImage('img
<input type=text name=captchacode size=25><br>
<BR>
<INPUT TYPE=submit value="Post">
</FORM>
</html>
guestbook.asp
<%
function TestCaptcha(byval valSession, byval valCaptcha)
dim tmpSession
valSession = Trim(valSession)
valCaptcha = Trim(valCaptcha)
if (valSession = vbNullString) or (valCaptcha = vbNullString) then
TestCaptcha = false
else
tmpSession = valSession
valSession = Trim(Session(valSession))
Session(tmpSession) = vbNullString
if valSession = vbNullString then
TestCaptcha = false
else
valCaptcha = Replace(valCaptcha,"i","I"
if StrComp(valSession,valCapt
TestCaptcha = true
else
TestCaptcha = false
end if
end if
end if
end function
%>
<%
Set fs = CreateObject("Scripting.Fi
Folderpath=server.mappath(
Wcounter=Folderpath &"/counter.txt"
if request.form<>"" then
if TestCaptcha("ASPCAPTCHA", Request.Form("captchacode"
Wemail = Request.Form("visitorsemai
test1=instr(Wemail, "@") ' value must be >1
test2=instr(Wemail, ".") ' value must be >4
test3=len(Wemail) ' value must be >6
test4=InStr (test1,Wemail,".",1) ' value must be >test1+2
if test1<2 OR test2<5 OR test3<7 OR test4<test1+3 then
response.write(Wemail & " is not a valid email address<p>")
email_Test=0
else
email_Test=1
end if
if email_Test=1 then
Set fs = CreateObject("Scripting.Fi
if fs.FolderExists(Folderpath
Set a = fs.OpenTextFile(Wcounter)
counter = Clng(a.ReadLine)
counter = counter + 1
a.close
else
Set a = fs.CreateFolder(Folderpath
counter=1
end if
Set a = fs.CreateTextFile(Wcounter
a.WriteLine(counter)
a.Close
Set fs=nothing
Set fs = CreateObject("Scripting.Fi
Set a = fs.CreateTextFile(Folderpa
a.WriteLine("<b><a HREF=mailto:" & Request.Form("visitorsemai
a.WriteLine(Request.Form("
a.Close
Set a=nothing
Set fs=nothing
end if
else
Response.Write("<b style=""color:#FF0000"">Yo
end if
end if
%>
ASKER
Thanks for your quick responce
On the guestbook.htm page I have a hyperlink "See GUESTBOOK "
when I click on that I get a blank page.
take a look www.tgcsnet.com my home page middle of page your see "Sign our guestbook" link click on that then you be on the page I am talking about
Then click on "See GUESTBOOK"
My asp code is not the best what would you suggest I but there to test?
On the guestbook.htm page I have a hyperlink "See GUESTBOOK "
when I click on that I get a blank page.
take a look www.tgcsnet.com my home page middle of page your see "Sign our guestbook" link click on that then you be on the page I am talking about
Then click on "See GUESTBOOK"
My asp code is not the best what would you suggest I but there to test?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok great
I would like to display the guestbook entries from the link "SEE GUESTBOOK"
I will check the permissions error later on.
Most likely a carrier over from the old server.
Also I may need another page to display the guest book? Something simple to display the text file that is in cgi-bin folder
I would like to display the guestbook entries from the link "SEE GUESTBOOK"
I will check the permissions error later on.
Most likely a carrier over from the old server.
Also I may need another page to display the guest book? Something simple to display the text file that is in cgi-bin folder
ok, i would then work on getting your save function working properly, make sure the correct permissions are set on your target folder. after that, follow the tutorial below on display the contents of your file to the screen:
http://www.coveryourasp.com/ShowFileDescr.asp
http://www.coveryourasp.com/ShowFileDescr.asp
ASKER
I got the permissions fixed.
When I make an entry to the guest book it shows the new entry
But when I click on the post button I get a blank page presented.
Does not end code not bring me back correctly?
Take a look see what you think
Thanks
When I make an entry to the guest book it shows the new entry
But when I click on the post button I get a blank page presented.
Does not end code not bring me back correctly?
Take a look see what you think
Thanks
ASKER
Also figured out the Guestbook not displaying.
Had incorrect name in hyper link.
old http://www.mydomain.com/guestbook.asp
new http://www.mydomain.com/guestbook2.asp
was missing the 2 that code displays the guestbook
Had incorrect name in hyper link.
old http://www.mydomain.com/guestbook.asp
new http://www.mydomain.com/guestbook2.asp
was missing the 2 that code displays the guestbook
if it's the link, it's because of this line:
if request.form<>"" then
when you click a link, nothing is posted, therefore the request object will be empty.
a simple test would be is to add a simple Response.Write at the top of the page and make sure it's not a server setting or a surpressed error.