Hello,
I have this piece of code to capture page title, but it gives me an error... Please Help!
Code:
<cfoutput><input type="hidden" name="prevurl" value="#CGI.HTTP_REFERER#">
<table width="318" border="0" bgcolor="FFFFFF" align="center">
<cffunction name="getPageTitle" returntype="string" output="false">
<cfargument name="pageurl" type="string" required="true">
<cfhttp method="get" redirect="true" url="#arguments.pageurl#" throwonerror="true"></cfhttp>
<cfreturn ReReplaceNoCase(cfhttp.fileContent, ".*<title>([^<>]*)</title>.*", "\1")>
</cffunction>
<cfset refurl="#CGI.HTTP_REFERER#"></cfoutput>
<cfoutput>#getPageTitle("refurl")#</cfoutput>
Error is in this line:
<cfreturn ReReplaceNoCase(cfhttp.fileContent, ".*<title>([^<>]*)</title>.*", "\1")>....
Just in time compilation error
Invalid token found on line 93 at position 27.( open parentheses) ColdFusion was looking at the following textInvalid expression element. The usual cause of this error is a misspelling in the expression text.
The last successfully parsed CFML construct was a CFRETURN tag occupying document position
I have this piece of code to capture page title, but it gives me an error... Please Help!
Code:
<cfoutput><input type="hidden" name="prevurl" value="#CGI.HTTP_REFERER#">
<table width="318" border="0" bgcolor="FFFFFF" align="center">
<cffunction name="getPageTitle" returntype="string" output="false">
<cfargument name="pageurl" type="string" required="true">
<cfhttp method="get" redirect="true" url="#arguments.pageurl#" throwonerror="true"></cfhttp>
<cfreturn ReReplaceNoCase(cfhttp.fileContent, ".*<title>([^<>]*)</title>.*", "\1")>
</cffunction>
<cfset refurl="#CGI.HTTP_REFERER#"></cfoutput>
<cfoutput>#getPageTitle("refurl")#</cfoutput>
Error is in this line:
<cfreturn ReReplaceNoCase(cfhttp.fileContent, ".*<title>([^<>]*)</title>.*", "\1")>....
Just in time compilation error
Invalid token found on line 93 at position 27.( open parentheses) ColdFusion was looking at the following textInvalid expression element. The usual cause of this error is a misspelling in the expression text.
The last successfully parsed CFML construct was a CFRETURN tag occupying document position