Solved

Web Site Development Help ASP Page does not display

Posted on 2013-11-14
7
1,775 Views
Last Modified: 2013-11-14
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  
 
 
 
%>
0
Comment
Question by:Thomas Grassi
  • 4
  • 3
7 Comments
 
LVL 32

Expert Comment

by:Big Monty
ID: 39647855
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.
0
 
LVL 23

Author Comment

by:Thomas Grassi
ID: 39647885
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?
0
 
LVL 32

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39647905
well that makes sense then. your guestbook.asp page looks like it only saves guestbook entries, there's nothing in the code that displays anything that would display anything. taking a closer look, it looks like it is only validating the CAPTCHA and then trying to write to a text file. if i try to fill out the guestbook, it gives me a permission denied error on line 61.

so lets take a step back here for a sec, what exactly are you trying to accomplish?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 23

Author Comment

by:Thomas Grassi
ID: 39648011
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
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 39648028
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
0
 
LVL 23

Author Comment

by:Thomas Grassi
ID: 39648574
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
0
 
LVL 23

Author Closing Comment

by:Thomas Grassi
ID: 39648605
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
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now