Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pass variable for 1|2|3 page

0 views
Skip to first unread message

Snake

unread,
Jul 28, 2002, 6:35:07 PM7/28/02
to
this is not a ColdFusion error, it is an IIS error.
This means there is a problem at the web server, so u should speak to your
sysadmin.
Also make sure you are linking to pages that actually existing, check for
typos.

"Kc539" <webfor...@macromedia.com> wrote in message
news:ai1r3i$pbn$1...@forums.macromedia.com...
> My problem is that this page the code is on (list.cfm) seems to need to
keep passing the #form.date# variable. As is, the page displays the links
correctly, but when page 2 which startrow=6 is clicked, the page gets the
500 internal server error & can't be displayed. How can I fix this problem?
> Here is the coding for the page:
> --------------------------------------------------------------------------
----
> <cfif isDefined('URL.StartRow')>
> <cfset StartRow=URL.StartRow>
> <cfelse>
> <cfset StartRow=1>
> </cfif>
>
> <cfquery datasource="ds" name="songs"
cachedwithin="#createTimeSpan(0,0,10,0)#">
> select * from Songs where date like '%#form.date#%'
> </cfquery>
>
> <cfset PageName="list.cfm">
> <cfset TotalRecords=songs.RecordCount>
> <cfset RecordsPerPage=5>
> <cfset NumberOfPages=Ceiling(TotalRecords/RecordsPerPage)>
> <cfset CurrentPageNumber=Ceiling(StartRow/RecordsPerPage)>
> <cfset EndRow=StartRow+RecordsPerPage-1>
>
> <cfoutput query="songs" startrow="#StartRow#"
maxrows="#RecordsPerPage#"> #flashsample# </cfoutput>
>
> <cfif NumberOfPages GT 1>
> <cfoutput> <cfif CurrentPageNumber GT 1>
> <cfset NextStartRow=StartRow - RecordsPerPage>
> <a
href="#PageName#?StartRow=#NextStartRow#">Previous</a>
> </cfif>
> <cfif CurrentPageNumber LT NumberOfPages>
> <cfset NextStartRow=StartRow + RecordsPerPage>
> <a
href="#PageName#?StartRow=#NextStartRow#">Next</a>
> </cfif>
>
> <cfloop index="Counter" from="1" to="#NumberOfPages#" step="1">
> <cfset
NextStartRow=(Counter*RecordsPerPage)-(RecordsPerPage-1)>
> <cfif Counter EQ CurrentPageNumber>#Counter#
> <cfelse>
> <a
href="#PageName#?StartRow=#NextStartRow#">#Counter#</a>
> </cfif>
> </cfloop>
>
> </cfoutput>
> </cfif>
>
>
>


Kc539

unread,
Jul 28, 2002, 6:26:58 PM7/28/02
to

Obry

unread,
Jul 29, 2002, 3:06:37 AM7/29/02
to
You are probably getting just a plain 500 internal error because you are
have Internet Explorer's default setting to "Show Friendly HTTP Error
Messages"... Go to Tools / Options / Advanced Setting and uncheck the
"Friendly HTTP" box and you should start seeing the actual errors produced
by CF...

Hope that helps your figure out the problem...


"Kc539" <webfor...@macromedia.com> wrote in message
news:ai1r3i$pbn$1...@forums.macromedia.com...

dcove

unread,
Jul 29, 2002, 1:25:46 PM7/29/02
to
Solved my problem......needed to add this code:
<CFPARAM NAME="pass" DEFAULT="">
<CFIF IsDefined("Form.date")>
<CFSET pass = Form.date>
<CFELSEIF IsDefined("URL.date")>
<CFSET pass = URL.date>
</CFIF>
and then change the query to: where date like '%#pass#%'
and then change the url for the 1|2|3 to: href= "#PageName#?StartRow=#NextStartRow#&date=#pass#"

Thanks anyway.


0 new messages