
10-22-03, 01:24 AM
|
|
New Member
|
|
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
problem with this script
I am getting an error 404 when I load this page. It is the default.asp. on the site. Am including the full code on here.
Could someone please help me debug it. All other pages are working perfect(if I go direct to them)and they also call the includes files...which means the problem is not with the include files at all.
It must be a small bug but am blinded totally on this.
Thanks
<%@ Language=VBScript %>
<!-- #include virtual="/includes/config.asp" -->
<!-- #include virtual="/includes/functions.asp" -->
<%
pageId = "00"
subPageId = "01"
imagesFolder1 = "\imagedata\content"
imagesFolder2 = "\imagedata\mpextras"
%>
<!-- Begin: Draw the top -->
<!-- #include virtual = "/includes/top.asp" -->
<%
dim historyArray,specialsArray
historyArray = Array("")
specialsArray = Array(1)
call drawTheTop(pageId,subPageId,historyArray,specialsA rray)
%>
<!-- End: Draw the top -->
<!-- Begin: The middle left inside table -->
<table cellspacing=0 cellpadding=0 border=0 width=586>
<tr valign=top>
<td>
<!-- Begin: The weather table -->
<table cellspacing=0 cellpadding=0 border=0 width=170>
<tr>
<td colspan=2 class="lnk-03"><img src="<%=defaultPath%>/images/weather.gif" width=36 height=36 border=0 vspace=3 hspace=3 align=left>MALINDI WEATHER
<br><%=MonthName(Month(Now()),true)%>, <%=Year(Now())%></td>
</tr>
<tr>
<td colspan=2 bgcolor="#FF9933"><img src="<%=defaultPath%>/images/spacer_01.gif" width=1 height=1 border=0></td>
</td>
<%
sqlmain ="select * from weather where int(monthId) = " & Month(Now())
weatherRecord.open sqlmain, connection, 1, 2
if weatherRecord.EOF then
Response.redirect defaultPath & "/error.asp?messageCode=errordb"
end if
%>
<tr>
<td height=16 class="lnk-04">Temperature (°C):</td>
<td class="lnk-04"><%=weatherRecord("temperatureCelsius")%></td>
</tr>
<tr>
<td height=16 class="lnk-04">Sunshine (hrs):</td>
<td class="lnk-04"><%=weatherRecord("dailyHoursSunshine")%></td>
</tr>
<tr>
<td height=16 class="lnk-04">Rainfall (cms):</td>
<td class="lnk-04"><%=weatherRecord("rainfallCms")%></td>
</tr>
<tr>
<td height=16 class="lnk-04">Humidity (%):</td>
<td class="lnk-04"><%=weatherRecord("humidityPercent")%></td>
</tr>
<tr>
<td colspan=2 bgcolor="#FF9933"><img src="<%=defaultPath%>/images/spacer_01.gif" width=1 height=1 border=0></td>
</td>
<tr>
<td class="lnk-02" colspan=2><div align=justify>We have put together some travel tips and facts. Click <a href="<%=defaultPath%>/facts/traveltips.asp">here.</div></td>
</tr>
<tr>
<td colspan=2 bgcolor="#FF9933"><img src="<%=defaultPath%>/images/spacer_01.gif" width=1 height=1 border=0></td>
</td>
<tr>
<td class="lnk-02" colspan=2><div align=justify>For coming events in Malindi and Driftwood, please check the calendar below.</div></td>
</tr>
</table>
<!-- End: The weather table -->
<!-- Begin: Draw calendar -->
<!-- #include virtual="/includes/calendar.asp" -->
<%
if Request.Querystring("currentMonth") <> "" then
currentMonth = int(Request.Querystring("currentMonth"))
else
currentMonth = month(now())
end if
if Request.Querystring("currentYear") <> "" then
currentYear = int(Request.Querystring("currentYear"))
else
currentYear = year(now())
end if
call drawCalendar(currentMonth,currentYear)
%>
<!-- End: Draw calendar -->
</td>
<td></td>
<td align=right>
<!-- Begin: Content top -->
<table cellspacing=0 cellpadding=0 border=0 width=406>
<tr>
<td class="lnk-02">
<%
sqlmain ="select * from content where contentPlace='" &_
pageId & subPageId & "'ORDER by contentSequence"
contentRecord.open sqlmain, connection, 1, 2
if contentRecord.EOF then
response.redirect defaultPath & "/error.asp?messageCode=invalidDBText"
end if
pictureReference = pathMe & imagesFolder1 & "\" & trim(contentRecord("contentId")) & ".jpg"
if picLocation.FileExists(pictureReference) then
writePic="<img src='" & defaultPath & replace(imagesFolder1,"\","/") & "/" & contentRecord("contentId") & ".jpg' width=100 height=150 border=1 hspace=5 align=left vspace=2 style='border-width: 1px; border-color: #000000'>"
end if
%>
<div align=justify><%=writePic%><font style="font-size:14px;font-weight:bold"><%=contentRecord("contentTitle")%></font>
<br><font style="font-size:12px"><%=displayText(contentRecord("contentSh ort"))%></font>
<br><br>:: <a href="<%=contentRecord("contentLink")%>">More about Driftwood Beach Club</a></div></td>
</tr>
<tr>
<td height=5></td>
</tr>
</table>
<!-- End: Content top -->
<!-- Begin: Quick reservation -->
<div class="div-03">
<table cellspacing=0 cellpadding=0 border=0 width=400>
<tr>
<td colspan=4>
<form method=post action="<%=defaultPath%>/getrates.asp" name="_getRates" onSubmit="return validateMe(this)">
</td>
</tr>
<tr>
<td colspan=4 class="lnk-02"><font style="font-size:12px;font-weight:bold">FAST RESERVATIONS</font></td>
</tr>
<tr>
<td class="lnk-02" height=20>Date of arrival</td>
<td>
<select name="aDay" size=1 class="buttonstyle-01">
<%
dayNow=day(now())
for iDay = dayNow to 31
%>
<option value="<%=iDay%>" <%=statusSelected%>><%=iDay%></option>
<%
next
%>
</select></td>
<td><select name="aMonth" size=1 class="buttonstyle-01">
<%
monthNow=month(now())
for iMonth=monthNow to 12
%>
<option value="<%=iMonth%>" <%=statusSelected%>><%=monthName(iMonth)%></option>
<%
next
%>
</select>
<select name="aYear" size=1 class="buttonstyle-01">
<%
yearNow=Year(Now())
for iYear = yearNow to yearNow+4
%>
<option value="<%=iYear%>" <%=statusSelected%>><%=iYear%></option>
<%
next
%>
</select></td>
<td colspan=2></td>
</tr>
<tr>
<td class="lnk-02" height=20>Date of departure</td>
<td>
<select name="dDay" size=1 class="buttonstyle-01">
<%
for iDay = dayNow to 31
%>
<option value="<%=iDay%>" <%=statusSelected%>><%=iDay%></option>
<%
next
%>
</select></td>
<td><select name="dMonth" size=1 class="buttonstyle-01">
<%
for iMonth=monthNow to 12
%>
<option value="<%=iMonth%>" <%=statusSelected%>><%=monthName(iMonth)%></option>
<%
next
%>
</select>
<select name="dYear" size=1 class="buttonstyle-01">
<%
for iYear = yearNow to yearNow+4
%>
<option value="<%=iYear%>" <%=statusSelected%>><%=iYear%></option>
<%
next
%>
</select>
</td>
<td width=100></td>
</tr>
<tr>
<td class="lnk-02" height=20>Number of rooms</td>
<td><input type=text name=numberOfRooms size=2 maxlength=3 value="1" class="buttonstyle-01" onBlur="return validateMeField(_getRates.numberOfRooms)"></td>
<td class="lnk-02" height=20>Number of adults / room</td>
<td><input type=text name=numberOfAdults size=2 maxlength=3 value="1" class="buttonstyle-01" onBlur="return validateMeField(_getRates.numberOfAdults)"></td>
</tr>
<tr>
<td colspan=4 class="lnk-04"><input type=submit name=submitForm value="Get rates" class="buttonstyle-01"> :: <a href="<%=defaultPath%>/accommodation/default.asp">More about our rooms</a> :: <a href="<%=defaultPath%>/accommodation/terms.asp">Terms and conditions</a></td>
</tr>
<tr>
<td colspan=4></form></td>
</tr>
</table>
</div>
<!-- End: Quick reservation -->
<!-- Begin: Content top -->
<table cellspacing=0 cellpadding=0 border=0 width=406>
<tr valign=top>
<td class="lnk-02">
<%
if TypeName(contentRecord) = "Recordset" then
if contentRecord.state <> adStateClosed then
contentRecord.close
end if
end if
sqlmain ="select * from content where contentPlace='" &_
pageId & subPageId & "' ORDER by contentSequence"
contentRecord.open sqlmain, connection, 1, 2
if contentRecord.EOF then
response.redirect defaultPath & "/error.asp?messageCode=invalidDBText"
end if
pictureReference = pathMe & imagesFolder2 & "\" & trim(contentRecord("contentId")) & ".gif"
if picLocation.FileExists(pictureReference) then
writePic="<a href='" & defaultPath & contentRecord("contentLink") & "'><img src='" & defaultPath & replace(imagesFolder2,"\","/") & "/" & contentRecord("contentId") & ".gif' width=75 height=75 border=1 hspace=5 align=left vspace=2 style='border-width: 1px; border-color: #000000'></a>"
end if
%>
<div align=justify><%=writePic%><font style="font-size:12px;font-weight:bold"><%=contentRecord("contentTitle")%></font>
<br><%=displayText(contentRecord("contentShort"))% >
<br>:: <a href="<%=contentRecord("contentLink")%>">More about</a></div></td>
<td></td>
<td class="lnk-02">
<%
contentRecord.MoveNext
if contentRecord.EOF then
response.redirect defaultPath & "/error.asp?messageCode=invalidDBText"
end if
pictureReference = pathMe & imagesFolder2 & "\" & trim(contentRecord("contentId")) & ".gif"
if picLocation.FileExists(pictureReference) then
writePic="<a href='" & defaultPath & contentRecord("contentLink") & "'><img src='" & defaultPath & replace(imagesFolder2,"\","/") & "/" & contentRecord("contentId") & ".gif' width=75 height=75 border=1 hspace=5 align=left vspace=2 style='border-width: 1px; border-color: #000000'></a>"
end if
%>
<div align=justify><%=writePic%><font style="font-size:12px;font-weight:bold"><%=contentRecord("contentTitle")%></font>
<br><%=displayText(contentRecord("contentShort"))% >
<br>:: <a href="<%=contentRecord("contentLink")%>">More about</a></div></td>
</tr>
<tr>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=200 height=5 border=0></td>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=6 height=1 border=0></td>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=200 height=1 border=0></td>
</tr>
</table>
<!-- End: Content top -->
</td>
</tr>
<!-- Begin: Spacing cells -->
<tr>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=170 height=1 border=0></td>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=5 height=1 border=0></td>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=411 height=1 border=0></td>
</tr>
<!-- End: Spacing cells -->
</table>
<!-- End: The middle left inside table -->
<!-- Begin: Draw the bottom -->
<!-- #include virtual="/includes/bottom.asp" -->
<%
call drawTheBottom(pageId,subPageId)
call destroyAll 'set recordsets to nothing'
%>
<!-- End: Draw the bottom -->
|

10-22-03, 10:05 AM
|
|
Coding Addict
|
|
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
|
Originally Posted by Ken
I am getting an error 404 when I load this page. It is the default.asp. on the site. Am including the full code on here.
Could someone please help me debug it. All other pages are working perfect(if I go direct to them)and they also call the includes files...which means the problem is not with the include files at all.
It must be a small bug but am blinded totally on this.
Thanks
<%@ Language=VBScript %>
<!-- #include virtual="/includes/config.asp" -->
<!-- #include virtual="/includes/functions.asp" -->
<%
pageId = "00"
subPageId = "01"
imagesFolder1 = "\imagedata\content"
imagesFolder2 = "\imagedata\mpextras"
%>
<!-- Begin: Draw the top -->
<!-- #include virtual = "/includes/top.asp" -->
<%
dim historyArray,specialsArray
historyArray = Array("")
specialsArray = Array(1)
call drawTheTop(pageId,subPageId,historyArray,specialsA rray)
%>
<!-- End: Draw the top -->
<!-- Begin: The middle left inside table -->
<table cellspacing=0 cellpadding=0 border=0 width=586>
<tr valign=top>
<td>
<!-- Begin: The weather table -->
<table cellspacing=0 cellpadding=0 border=0 width=170>
<tr>
<td colspan=2 class="lnk-03"><img src="<%=defaultPath%>/images/weather.gif" width=36 height=36 border=0 vspace=3 hspace=3 align=left>MALINDI WEATHER
<br><%=MonthName(Month(Now()),true)%>, <%=Year(Now())%></td>
</tr>
<tr>
<td colspan=2 bgcolor="#FF9933"><img src="<%=defaultPath%>/images/spacer_01.gif" width=1 height=1 border=0></td>
</td>
<%
sqlmain ="select * from weather where int(monthId) = " & Month(Now())
weatherRecord.open sqlmain, connection, 1, 2
if weatherRecord.EOF then
Response.redirect defaultPath & "/error.asp?messageCode=errordb"
end if
%>
<tr>
<td height=16 class="lnk-04">Temperature (°C):</td>
<td class="lnk-04"><%=weatherRecord("temperatureCelsius")%></td>
</tr>
<tr>
<td height=16 class="lnk-04">Sunshine (hrs):</td>
<td class="lnk-04"><%=weatherRecord("dailyHoursSunshine")%></td>
</tr>
<tr>
<td height=16 class="lnk-04">Rainfall (cms):</td>
<td class="lnk-04"><%=weatherRecord("rainfallCms")%></td>
</tr>
<tr>
<td height=16 class="lnk-04">Humidity (%):</td>
<td class="lnk-04"><%=weatherRecord("humidityPercent")%></td>
</tr>
<tr>
<td colspan=2 bgcolor="#FF9933"><img src="<%=defaultPath%>/images/spacer_01.gif" width=1 height=1 border=0></td>
</td>
<tr>
<td class="lnk-02" colspan=2><div align=justify>We have put together some travel tips and facts. Click <a href="<%=defaultPath%>/facts/traveltips.asp">here.</div></td>
</tr>
<tr>
<td colspan=2 bgcolor="#FF9933"><img src="<%=defaultPath%>/images/spacer_01.gif" width=1 height=1 border=0></td>
</td>
<tr>
<td class="lnk-02" colspan=2><div align=justify>For coming events in Malindi and Driftwood, please check the calendar below.</div></td>
</tr>
</table>
<!-- End: The weather table -->
<!-- Begin: Draw calendar -->
<!-- #include virtual="/includes/calendar.asp" -->
<%
if Request.Querystring("currentMonth") <> "" then
currentMonth = int(Request.Querystring("currentMonth"))
else
currentMonth = month(now())
end if
if Request.Querystring("currentYear") <> "" then
currentYear = int(Request.Querystring("currentYear"))
else
currentYear = year(now())
end if
call drawCalendar(currentMonth,currentYear)
%>
<!-- End: Draw calendar -->
</td>
<td></td>
<td align=right>
<!-- Begin: Content top -->
<table cellspacing=0 cellpadding=0 border=0 width=406>
<tr>
<td class="lnk-02">
<%
sqlmain ="select * from content where contentPlace='" &_
pageId & subPageId & "'ORDER by contentSequence"
contentRecord.open sqlmain, connection, 1, 2
if contentRecord.EOF then
response.redirect defaultPath & "/error.asp?messageCode=invalidDBText"
end if
pictureReference = pathMe & imagesFolder1 & "\" & trim(contentRecord("contentId")) & ".jpg"
if picLocation.FileExists(pictureReference) then
writePic="<img src='" & defaultPath & replace(imagesFolder1,"\","/") & "/" & contentRecord("contentId") & ".jpg' width=100 height=150 border=1 hspace=5 align=left vspace=2 style='border-width: 1px; border-color: #000000'>"
end if
%>
<div align=justify><%=writePic%><font style="font-size:14px;font-weight:bold"><%=contentRecord("contentTitle")%></font>
<br><font style="font-size:12px"><%=displayText(contentRecord("contentSh ort"))%></font>
<br><br>:: <a href="<%=contentRecord("contentLink")%>">More about Driftwood Beach Club</a></div></td>
</tr>
<tr>
<td height=5></td>
</tr>
</table>
<!-- End: Content top -->
<!-- Begin: Quick reservation -->
<div class="div-03">
<table cellspacing=0 cellpadding=0 border=0 width=400>
<tr>
<td colspan=4>
<form method=post action="<%=defaultPath%>/getrates.asp" name="_getRates" onSubmit="return validateMe(this)">
</td>
</tr>
<tr>
<td colspan=4 class="lnk-02"><font style="font-size:12px;font-weight:bold">FAST RESERVATIONS</font></td>
</tr>
<tr>
<td class="lnk-02" height=20>Date of arrival</td>
<td>
<select name="aDay" size=1 class="buttonstyle-01">
<%
dayNow=day(now())
for iDay = dayNow to 31
%>
<option value="<%=iDay%>" <%=statusSelected%>><%=iDay%></option>
<%
next
%>
</select></td>
<td><select name="aMonth" size=1 class="buttonstyle-01">
<%
monthNow=month(now())
for iMonth=monthNow to 12
%>
<option value="<%=iMonth%>" <%=statusSelected%>><%=monthName(iMonth)%></option>
<%
next
%>
</select>
<select name="aYear" size=1 class="buttonstyle-01">
<%
yearNow=Year(Now())
for iYear = yearNow to yearNow+4
%>
<option value="<%=iYear%>" <%=statusSelected%>><%=iYear%></option>
<%
next
%>
</select></td>
<td colspan=2></td>
</tr>
<tr>
<td class="lnk-02" height=20>Date of departure</td>
<td>
<select name="dDay" size=1 class="buttonstyle-01">
<%
for iDay = dayNow to 31
%>
<option value="<%=iDay%>" <%=statusSelected%>><%=iDay%></option>
<%
next
%>
</select></td>
<td><select name="dMonth" size=1 class="buttonstyle-01">
<%
for iMonth=monthNow to 12
%>
<option value="<%=iMonth%>" <%=statusSelected%>><%=monthName(iMonth)%></option>
<%
next
%>
</select>
<select name="dYear" size=1 class="buttonstyle-01">
<%
for iYear = yearNow to yearNow+4
%>
<option value="<%=iYear%>" <%=statusSelected%>><%=iYear%></option>
<%
next
%>
</select>
</td>
<td width=100></td>
</tr>
<tr>
<td class="lnk-02" height=20>Number of rooms</td>
<td><input type=text name=numberOfRooms size=2 maxlength=3 value="1" class="buttonstyle-01" onBlur="return validateMeField(_getRates.numberOfRooms)"></td>
<td class="lnk-02" height=20>Number of adults / room</td>
<td><input type=text name=numberOfAdults size=2 maxlength=3 value="1" class="buttonstyle-01" onBlur="return validateMeField(_getRates.numberOfAdults)"></td>
</tr>
<tr>
<td colspan=4 class="lnk-04"><input type=submit name=submitForm value="Get rates" class="buttonstyle-01"> :: <a href="<%=defaultPath%>/accommodation/default.asp">More about our rooms</a> :: <a href="<%=defaultPath%>/accommodation/terms.asp">Terms and conditions</a></td>
</tr>
<tr>
<td colspan=4></form></td>
</tr>
</table>
</div>
<!-- End: Quick reservation -->
<!-- Begin: Content top -->
<table cellspacing=0 cellpadding=0 border=0 width=406>
<tr valign=top>
<td class="lnk-02">
<%
if TypeName(contentRecord) = "Recordset" then
if contentRecord.state <> adStateClosed then
contentRecord.close
end if
end if
sqlmain ="select * from content where contentPlace='" &_
pageId & subPageId & "' ORDER by contentSequence"
contentRecord.open sqlmain, connection, 1, 2
if contentRecord.EOF then
response.redirect defaultPath & "/error.asp?messageCode=invalidDBText"
end if
pictureReference = pathMe & imagesFolder2 & "\" & trim(contentRecord("contentId")) & ".gif"
if picLocation.FileExists(pictureReference) then
writePic="<a href='" & defaultPath & contentRecord("contentLink") & "'><img src='" & defaultPath & replace(imagesFolder2,"\","/") & "/" & contentRecord("contentId") & ".gif' width=75 height=75 border=1 hspace=5 align=left vspace=2 style='border-width: 1px; border-color: #000000'></a>"
end if
%>
<div align=justify><%=writePic%><font style="font-size:12px;font-weight:bold"><%=contentRecord("contentTitle")%></font>
<br><%=displayText(contentRecord("contentShort"))% >
<br>:: <a href="<%=contentRecord("contentLink")%>">More about</a></div></td>
<td></td>
<td class="lnk-02">
<%
contentRecord.MoveNext
if contentRecord.EOF then
response.redirect defaultPath & "/error.asp?messageCode=invalidDBText"
end if
pictureReference = pathMe & imagesFolder2 & "\" & trim(contentRecord("contentId")) & ".gif"
if picLocation.FileExists(pictureReference) then
writePic="<a href='" & defaultPath & contentRecord("contentLink") & "'><img src='" & defaultPath & replace(imagesFolder2,"\","/") & "/" & contentRecord("contentId") & ".gif' width=75 height=75 border=1 hspace=5 align=left vspace=2 style='border-width: 1px; border-color: #000000'></a>"
end if
%>
<div align=justify><%=writePic%><font style="font-size:12px;font-weight:bold"><%=contentRecord("contentTitle")%></font>
<br><%=displayText(contentRecord("contentShort"))% >
<br>:: <a href="<%=contentRecord("contentLink")%>">More about</a></div></td>
</tr>
<tr>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=200 height=5 border=0></td>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=6 height=1 border=0></td>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=200 height=1 border=0></td>
</tr>
</table>
<!-- End: Content top -->
</td>
</tr>
<!-- Begin: Spacing cells -->
<tr>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=170 height=1 border=0></td>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=5 height=1 border=0></td>
<td><img src="<%=defaultPath%>/images/spacer_01.gif" width=411 height=1 border=0></td>
</tr>
<!-- End: Spacing cells -->
</table>
<!-- End: The middle left inside table -->
<!-- Begin: Draw the bottom -->
<!-- #include virtual="/includes/bottom.asp" -->
<%
call drawTheBottom(pageId,subPageId)
call destroyAll 'set recordsets to nothing'
%>
<!-- End: Draw the bottom -->
|
If you're getting a 404 error, then the url you're requested cannot be found. Check and make sure your redirects in your script actually exist.
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|