KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Changing standard 4D HTML response pages
PRODUCT: 4D | VERSION: 6.5 | PLATFORM: Mac & Win
Published On: November 30, 2001

If you have been doing 4D Web Development, you will have seen some of the default error pages that 4D shows for things like "Page not found." The look of these pages may not match the look of your site. You can change these error pages, however. You can see all of the HTML pages in the 4D Application using ResEdit. You can copy these resources into your 4D structure file and change them there. Here is an example of some 4D Code that can be used to change the resource contents.

`$1: Longint - Html Resource ID # to Set
`$2: Text - HTML to set for Resource

C_LONGINT($1)
C_TEXT($2)

C_LONGINT($iResourceID)
C_TEXT($tHTML)
$iResourceID:=$1
$tHTML:=$2
C_TIME($hStructureFile)
$hStructureFile:=Open resource file(Structure file)

If (OK=1)
C_BLOB($xData)
TEXT TO BLOB($tHTML;$xData;Text without length )
SET RESOURCE("Html";$iResourceID;$xData;$hStructureFile)
CLOSE RESOURCE FILE($hStructureFile)
End if
`end