- Difference with FileDisplay
- Use in PHP
- Pre-launched sessions
In french: ChaîneAffiche
Returns a specific string (or a buffer) to the client browser in response to a request. Allows you to display documents in the browser of Web user without having to use a file.
In this version, this function can only be used to return a specific string.
s is string
s = "<HTML>Text '''bold'''</HTML>"
StringDisplay(<Buffer\Character string> [, <MIME type> [, <Name of file for backup>]])
<Buffer\Character string>: Buffer or character string
Buffer or character string that will be displayed in the browser.
<MIME type>: Optional Ansi character string
- Name of MIME type to use. The MIME type allows you to indicate to the browser the type of string to use. More than 150 types are defined in the MIME communication standard (available on Internet). The most common values recognized by most browsers are:
- "application/pdf": document in PDF format (*.pdf)
- "text/html": HTML page (*.htm, *.html)
- "text/plain": text file (*.txt)
- "image/gif": image in GIF format (*.gif)
- "image/jpeg": image in JPEG format (*.jpg, *.jpeg)
- "video/mpeg": video in MPEG format (*.mpg, *.mpeg)
- MIME type corresponding to one of the following constants:
|typeMimeXMLApplication||XML content. |
|typeMimeBinary||Binary content (byte stream). |
|typeMimeDOC||Content such as Word file (*.doc)|
|typeMimeDOCX||Content such as Word file (*.docx)|
|typeMimeGIF||Content such as Image in GIF format (*.gif)|
|typeMimeHTML||Content such as HTML page (*.htm, *.html)|
|typeMimeJPEG||Content such as image in JPEG format (*.jpg, *.jpeg)|
|typeMimeJSON||JSON content. |
|typeMimePDF||Content such as PDF document (*.pdf)|
|typeMimePNG||Content such as image in JPEG format (*.png)|
|typeMimeSOAP||SOAP content in XML format. |
|typeMimeText||Content in text format (*.txt)|
|typeMimeXMLText||Text content in XML format|
|typeMimeXLS||Content in Excel format (*.xls)|
|typeMimeXLSX||Content in Excel format (*.xlsx)|
|typeMimeZIP||Content in ZIP format (*.zip)|
<Name of file for backup>: Optional character string
Name of file to save if the Web user wants to download the file onto his computer. If this parameter is specified, the file download is automatically proposed.
Difference with FileDisplay
This function is equivalent to FileDisplay
but the source used in a memory string (instead of a file).
Use in PHP
In PHP, the traces displayed in the page by Trace
are also displayed by StringDisplay
. Indeed, all the page codes are run before displaying the page: the traces are taken into account by StringDisplay
If your project uses pre-launched sessions, this function must not be used in the project initialization event. This function must be used in the "Initializing the project after connection to the site" event.
Business / UI classification: UI Code