 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 31st, 2005, 05:07 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Syntax Error
Hi guys,
I am running an ASP application on two web servers. It is totally fine on one server, however, I keep getting a "done but with errors on page" message at the lower left bottom of the page when I am running it on another web server, and it drives me crazy. When I opened it up, the message just says "syntax error, at line 2, char 2". It was just an "Include file" command at this position in the file. The two servers should be almost the same.
Did any of you have similar experiences before? Thanks!
Cinderella
|
|

January 31st, 2005, 05:17 PM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
can u paste the code?
Om Prakash
|
|

January 31st, 2005, 05:23 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you for your reply! The code is really long, but here it is:
<script>
function runEx(cod1) {
cod=document.all(cod1)
var code=cod.value;
if (code!=""){
var newwin=window.open('','','');
newwin.opener = null
newwin.document.write('<link rel="stylesheet" type="text/css" href="styles.css">')
newwin.document.write(code);
newwin.document.close();
}
}
function check(theForm) {
if(theForm.key.value == "" ) {
alert("No Keyword!");
return false;
}
}
</script>
<%
sql="select * from moban where m_id="&m_id&""
set rs=conn.EXECUTE(sql)
if rs.eof or rs.bof then
sql="select * from moban where m_id=1"
set rs=conn.EXECUTE(sql)
end if
mb_code=rs("m_html")
rs.close
set rs=nothing
checkuser()
mb_code=replace(mb_code,"$checkuser$",check_user)
calenda l_year,l_month,l_day
mb_code=replace(mb_code,"$calenda$",ccode)
getTop()
mb_code=replace(mb_code,"$top10$",tcode)
'getMusic()
mb_code=replace(mb_code,"$music_box$",mbcode)
getRss()
mb_code=replace(mb_code,"$rss$",rsscode)
'getBlogcn()
'mb_code=replace(mb_code,"$blogcn$",blogcncode)
getloginfo()
mb_code=replace(mb_code,"$log_info$",icode)
getcatlist()
mb_code=replace(mb_code,"$log_cat_list$",lcode)
getsearchcode()
mb_code=replace(mb_code,"$search_form$",sccode)
dim viewtype,ASPLOG,sql_view,urladd,oyear,omonth,oday, bdate,Mcode
dim plist,maxpages,mypage
sub getmaincode
viewtype=request("vt")
if not isempty(request("page")) then
Mypage=cint(Request("page"))
else
Mypage=1
end if
set ASPLOG = Server.CreateObject("ADODB.Recordset")
select case viewtype
case "search"
if cat_id=0 then
sadd=" "
else
sadd=" and cat_id="&cat_id&" "
end if
key=trim(request.form("key"))
sql_view="SELECT * FROM log WHERE (log_tittle like '%"&key&"%' or log_content like '%"&key&"%') "&sadd&" ORDER BY log_id desc"
urladd="vt=search&key="&key
txtadd="keyword[<b>"&key&"</b>] "
case "bycat"
sql_view="SELECT * FROM log WHERE cat_id="&cat_id&" ORDER BY log_id desc"
urladd="vt=bycat&cat_id="&cat_id
txtadd="category ["&nowcat&"] "
case "byday"
sql_view="SELECT * FROM log WHERE l_year="&l_year&" AND l_month="&l_month&" AND l_day="&l_day&" ORDER BY log_id desc"
urladd="vt=byday&l_year="&l_year&"&l_month="&l_mon th&"&l_day="&l_day
txtadd=""&l_year&"-"&l_month&"-"&l_day&" "
case "bymonth"
sql_view="SELECT * FROM log WHERE l_year="&l_year&" AND l_month="&l_month&" ORDER BY log_id desc"
urladd="vt=bymonth&l_year="&l_year&"&l_month="&l_m onth
txtadd=""&l_year&"-"&l_month&" "
case "byyear"
sql_view="SELECT * FROM log WHERE l_year="&l_year&" ORDER BY log_id desc"
urladd="vt=byyear&l_year="&l_year
txtadd="In "&l_year&" there is(are) "
case "byct"
sql_view="SELECT * FROM log WHERE lr_count>0 ORDER BY log_id desc"
urladd="vt=byct"
txtadd="Commented Log"
case "byview"
sql_view="SELECT * FROM log where lv_count>0 ORDER BY lv_count desc"
urladd="vt=byview"
txtadd="Log sorted by date"
case "bycomment"
sql_view="SELECT * FROM log where lr_count>0 ORDER BY lr_count desc"
urladd="vt=bycomment"
txtadd="Log sorted by comment"
end select
if sql_view="" then
sql_view="SELECT * FROM log ORDER BY log_id desc"
urladd="vt=default"
txtadd="Total: "
'sql_view="SELECT top 5 * FROM log ORDER BY log_id desc"
'txtadd=" "
end if
'set ASPLOG=conn.EXECUTE(sql_view)
ASPLOG.open sql_view,conn,1,1
if ASPLOG.eof then
mcode=mcode&txtadd&"0 log"
exit sub
end if
ASPLOG.pagesize=Mypagesize
maxpages=cint(ASPLOG.pagecount)
totalsize=cint(Mypagesize)
ASPLOG.absolutepage=Mypage
GuestTotal=ASPLOG.RecordCount
if cint(Mypage) >1 then
if cint(Mypage) > maxpages then
mcode=mcode&"Empty Page."
exit sub
end if
end if
pagelink GuestTotal
mcode=mcode&"<table width='100%' border='0' cellspacing='0' cellpadding='4'><tr><td><img src='images/lead.gif' hspace='4' align='absmiddle'>"&txtadd&""&GuestTotal&" log(s) | "&MyPageSize&" logs Per Page | Page "&cint(Mypage)&" [Page Total: "&maxpages&"] <br> "&plist&"</td></tr></table>"
mcode=mcode&"<table border='0' cellspacing='1' cellpadding='0' bgcolor='"&color1&"' width='100%'>"
ic = 0
total = 0
do until ASPLOG.Eof or total = totalsize
if oyear=ASPLOG("l_year") and omonth=ASPLOG("l_month") and oday=ASPLOG("l_day") then
bdate="false"
else
bdate="true"
oyear=ASPLOG("l_year")
omonth=ASPLOG("l_month")
oday=ASPLOG("l_day")
end if
if ic = 0 then
CColor = Color1
else
CColor = Color2
end if
mcode=mcode&"<tr bgcolor="&CColor&"><td>"
checkhide(ASPLOG("cat_id"))
'====================
'if noneshow="true" AND not (ULogin="true" and isad<0) then
'mcode=mcode&"<table border='0' cellspacing='0' cellpadding='2' width='100%'><tr><td> [ ]"
'if bdate="true" then
'mcode=mcode&" ["&ASPLOG("l_year")&"-"&ASPLOG("l_month")&"-"&ASPLOG("l_day")&"]"
'else
'mcode=mcode&"["&ASPLOG("l_year")&"-"&ASPLOG("l_month")&"-"&ASPLOG("l_day")&"]"
'end if
'mcode=mcode&"</td></tr></table>"
'else
'================================================= ====
if noneshow<>"true" or (ULogin="true" and isad<0) then
mcode=mcode&"<table border='0' cellspacing='0' cellpadding='2' width='100%'><tr><td class='log_title' width='3'>"
if log_view_type=-1 then
title_link_1="<a href='showlog.asp?cat_id="&ASPLOG("cat_id")&"&log_ id="&ASPLOG("log_id")&"'>"
title_link_2="</a>"
else
title_link_1=""
title_link_2=""
end if
mcode=mcode&"<img src='images/icon_title.gif' align='top' /></td>"
mcode=mcode&"<td valign='top'> "&title_link_1&"<b><a href=showlog.asp?cat_id="&ASPLOG("cat_id")&"&log_i d="&ASPLOG("log_id")&">"&ASPLOG("log_tittle")&"</a></b>"&title_link_2&""
if bdate="true" then
mcode=mcode&" ["&ASPLOG("l_year")&"-"&ASPLOG("l_month")&"-"&ASPLOG("l_day")&"]<br>"
mcode=mcode&" <IMG src='images/hn2_t_"&ASPLOG("log_weather")&".gif' /> <img src='images/hn2_"&ASPLOG("log_weather")&".gif' align='absmiddle' /> <img src='images/face"&ASPLOG("face")&".gif' alt='Mood Index#"&ASPLOG("face")&"' />" 'by Poorfish
else
mcode=mcode&" ["&ASPLOG("l_year")&"-"&ASPLOG("l_month")&"-"&ASPLOG("l_day")&"]<br>"
mcode=mcode&" <IMG src='images/hn2_t_"&ASPLOG("log_weather")&".gif' /> <img src='images/hn2_"&ASPLOG("log_weather")&".gif' align='absmiddle' /> <img src='images/face"&ASPLOG("face")&".gif' alt='Mood Index#"&ASPLOG("face")&"' />" 'by Poorfish
end if
mcode=mcode&"</td><td align=right valign='top'><a href=showlog.asp?cat_id="&ASPLOG("cat_id")&"&log_i d="&ASPLOG("log_id")&">[Read]</a> </td></tr></table>"
if log_view_type=1 or log_view_type=0 then
mcode=mcode&"<table border='0' cellspacing='8' cellpadding='0' width='100%' style='word-break:break-all; table-layout:fixed'><tr><td valign='top' class='content'>"
realcontent=ASPLOG("log_content")
if ASPLOG("log_type")=1 then
realcontent=realcontent
else
realcontent=unhtml(realcontent)
if ASPLOG("allows")=0 then realcontent=Smilies(realcontent)
if ASPLOG("allowubb")=0 then realcontent=ubb(realcontent)
end if
if log_view_type=1 then
realcontent=splitLines(realcontent,log_cut_line,AS PLog("log_id"),ASPLog("cat_id"))
end if
mcode=mcode&realcontent
mcode=mcode&"</td></tr></table>"
end if
mcode=mcode&"<table border='0' cellspacing='4' cellpadding='0' align='right'><tr><td style='font-size:10px' align='right'>"
if viewtype<>"bycat" then
getcatname(ASPLOG("cat_id"))
inwhichcatcode=" in [<a href='index.asp?vt=bycat&cat_id="&ASPLOG("cat_id") &"'>"&incat&"</a>] "
end if
''
sql = "select count(*) from trackback where blogArId="&ASPLOG("log_ID")
set rs = conn.Execute(sql)
dim tbCount
tbCount = rs(0)
''end
if username=ASPLOG("log_author") or isad=-1 then
if ASPLOG("log_type")=1 Then
mcode=mcode&" <a href='edit_log.asp?log_id="&ASPLOG("log_id")&"'><i mg src='images/icon_edit.gif' border='0' alt='Edit or delete this log' align='absmiddle'></a></td></tr>"
else
mcode=mcode&" <a href='edit_log_ubb.asp?log_id="&ASPLOG("log_id")&" '><img src='images/icon_edit.gif' border='0' alt='Edit or delete this log' align='absmiddle'></a></td></tr>"
end if
end if
mcode=mcode&"<tr><td height='1' background='images/LINE1.gif'></td></tr>"
mcode=mcode&"<tr><td> </td></tr></table>"
mcode=mcode&"</td></tr>"
end if
ASPLOG.MoveNext
ic = ic + 1
if ic = 2 then ic = 0
total = total + 1
loop
mcode=mcode&"</table>"
mcode=mcode&"<table width='100%' border='0' cellspacing='0' cellpadding='4'><tr><td> "&Plist&"</td></tr></table>"
ASPLOG.close
set ASPLOG=nothing
end sub
getmaincode
mb_code=replace(mb_code,"$main_content$",mcode)
response.write mb_code
%>
<%
function PageLink (GuestTotal)
PageShowSize = 10
Scriptname=Request.Servervariables("script_name")
PageNextSize=int((MyPage-1)/PageShowSize)+1
Pagetpage=int((GuestTotal-1)/MyPageSize)+1
if Maxpages > 1 then
if PageNextSize >1 then
PagePrev=PageShowSize*(PageNextSize-1)
plist=plist&"<a href='" & Scriptname & "?"&urladd&"&page=" & PagePrev & "'>[<<]</a>-"
end if
if Mypage-1 > 0 then
Prev_Page = MyPage - 1
plist=plist&"<a href='" & Scriptname & "?"&urladd&"&page=" & Prev_Page & "'>[<]</a> "
end if
if maxpages>=PageNextSize*PageShowSize then
PageSizeShow = PageShowSize
else
PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
end if
for PageCounterSize=1 to PageSizeShow
PageLink = (PageCounterSize+PageNextSize*10)-10
if PageLink <> cint(Mypage) then
plist=plist&"<a href='" & Scriptname & "?"&urladd&"&page=" & PageLink & "'>[" & PageLink & "]</a> "
else
plist=plist&PageLink & " "
end if
next
if Mypage+1 <=Pagetpage then
Next_Page = MyPage + 1
plist=plist& "<a href='" & Scriptname & "?"&urladd&"&page=" & Next_Page & "'>[>]</a>"
end if
if maxpages > PageShowSize*PageNextSize then
PageNext = PageShowSize * PageNextSize + 1
plist=plist& "-<a href='" & Scriptname & "?"&urladd&"&page=" & PageNext & "'>[>>]</a>"
end if
else
plist=plist&"[1]"
end if
END function
conn.close
set conn=nothing
%>
|
|

January 31st, 2005, 05:54 PM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
I don't find code which calls the following javascript functions:
function runEx(cod1)
function check(theForm)
Om Prakash
|
|

February 1st, 2005, 05:13 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you so much! I removed the two functions and the error was gone! I really appreciate your help!
Cinderella
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Parse error: syntax error, unexpected T_ELSE in /h |
vipin k varghese |
BOOK: XSLT Programmer's Reference, 2nd Edition |
4 |
September 29th, 2011 01:19 AM |
| Ch 4: Parse error: syntax error, unexpected T_SL |
hanizar77 |
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 |
0 |
June 23rd, 2008 09:17 PM |
| Parse error: syntax error, unexpected T_STRING |
ginost7 |
Beginning PHP |
1 |
November 9th, 2007 02:51 AM |
| VB Error: Syntax Error or Access Violation |
codehappy |
VB How-To |
7 |
October 3rd, 2007 05:41 PM |
| Compile error: Syntax error: & Else without HELP |
Corey |
VB How-To |
2 |
April 21st, 2006 03:25 PM |
|
 |