Solved

Web Site Development Help ASP Page does not display

Posted on 2013-11-14
7
1,848 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 33

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 33

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
Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

 
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 33

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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

717 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