Help - Search - Members - Calendar
Full Version: Get page name
W3Schools Forum > Server Scripting > ColdFusion
vchris
How can I get the name of the page I am browsing? If I am on a page called page_e.cfm, I want the link to be page_f.cfm so basically change _e for _f.
aspnetguy
this code outputs the current url

CODE
<cfoutput>
      http://#cgi.server_name##cgi.script_name#?#cgi.query_string#
</cfoutput>


so I guess what you are looking for is #cgi.script_name#
vchris
Exactly what I needed! thank you.
Skemcin
when in doubt, use this to investigate exactly what you need.

<cfdump var"#cgi#" label="Use at will CGI variables!">

I put this and even a session dump in my "onrequestend.cfm" file. I keep it there commented out so I can easily get the information whenever i want. Not sure if you know that, but the "onrequestend.cfm" file works just like the "application.cfm" file except that it gets run at the end of every file. Its helpful in a number of situations.
Muhammad Tariq
#cgi.script_name#

if u are using dreamweaver 8.0 then when you type cgi. all script information u can get and u can chek it out
with the cfout
Muhammad Tariq
this code will help u just check it out

<cfparam name="URL.startrow" default="1" />

<cfset nNextRows = URL.startrow + 2 />
<cfset nPreviousRows = URL.startrow - 2 />


<head>

<title>Pageable Record</title>
</head>

<table>
<cfoutput>
<tr>

<cfif nNextRows LTE 10>
<td><a href="#CGI.SCRIPT_NAME#?startrow=#nNextRows#">Next Record</a></td>
</cfif>
<cfif nPreviousRows GTE 1>
<td><a href="#CGI.SCRIPT_NAME#?startrow=#nPreviousRows#">Previous Record</a></td>
</cfif>
</tr>
</cfoutput>

<cfoutput query="pageable" startrow="#url.startrow#" maxrows="2">




<tr>
<td>#per_name#</td>
<td>#per_phone#</td>
</tr>
</table>
</cfoutput>

<body>
</body>
</html>
vchris
This was in Feb this year... I figured it out!
Skemcin
QUOTE (vchris @ Oct 24 2007, 02:29 PM) *
This was in Feb this year... I figured it out!

took you that long - wow, what do you get per hour?
xd.gif
vchris
I get way too much laugh.gif

Don't play with me! I've killed for a lot less tongue.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.