Link to home
Start Free TrialLog in
Avatar of Member_2_6492660_1
Member_2_6492660_1Flag for United States of America

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/zero1011.css"><meta 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('imgCaptcha')">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,valCaptcha,1) = 0 then
                                TestCaptcha = true
                        else
                                TestCaptcha = false
                        end if
                end if          
        end if
end function
%>
 
<%
Set fs = CreateObject("Scripting.FileSystemObject")
 
Folderpath=server.mappath("\") & "/cgi-bin/guestbook"  
Wcounter=Folderpath &"/counter.txt"  
 
if request.form<>"" then  
 
        if TestCaptcha("ASPCAPTCHA", Request.Form("captchacode")) then
         
      Wemail = Request.Form("visitorsemail")
      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.FileSystemObject")  
           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.FileSystemObject")  
        Set a = fs.CreateTextFile(Folderpath & "\" & counter & ".txt")  
        a.WriteLine("<b><a HREF=mailto:" & Request.Form("visitorsemail") & ">" & Request.Form("visitorsname") & "</a></b>")  
        a.WriteLine(Request.Form("visitorsmessage"))  
        a.Close  
        Set a=nothing  
        Set fs=nothing  
       end if
 
                else
                        Response.Write("<b style=""color:#FF0000"">You entered the wrong code.</b>")
                end if
 
end if  
 
 
 
%>
Avatar of Big Monty
Big Monty
Flag of United States of America image

so nothing displays when you click the link? or does nothing display when you click the button?

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.
Avatar of Member_2_6492660_1

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?
ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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
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
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