ScriptBasic
May 25, 2013, 03:15:16 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: The ScriptBasic User, Developer and extension module guides are available at the
WIKI
.
Home
Wiki
Help
Search
Login
Register
ScriptBasic
>
Support
>
General Discussions
>
How to print html code?
Pages: [
1
]
« previous
next »
Print
Author
Topic: How to print html code? (Read 1266 times)
votan
Newbie
Posts: 7
How to print html code?
«
on:
February 21, 2010, 08:13:31 AM »
Is there an easy way to print html code (using sbhttpd)? So that the browser displays all the html code instead of interpreting it?
Current solution would be to parse all html and replace characters like "<>" with their chr-codes to make it work.... but there is propably an easier way to just escape that!?
Logged
support
Administrator
Posts: 555
Re: How to print html code?
«
Reply #1 on:
February 21, 2010, 10:28:18 AM »
View source in your browser.
The sbhttpd server executes programs. HTML is string data to SB and whatever you send to the browser is what will be displayed in the browser.
If you asking if you can view SB code in the browser the answer is no. SB doesn't parse embedded HTML scripts like php (which is a hackers dream) but executes a CGI binary program.
You could make a copy of your SB source outside the SB proxy directory and add a .txt to the end. This way the browser sees the file as text and displays it verbatim.
Hint:
I find it easier to wrap static HTML/JavaScript text in strings and PRINT them in my output section of my script after any preprocessing that needs to be done. SB also allows (like Python) to encapsulate multiple lines of text using
"""
(three quotes) and it will send that string to the browser as is with line breaks, tabs, ...
Logged
ScriptBasic Project Manager
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Open Forum
-----------------------------
=> Round Table
=> What's New
-----------------------------
ScriptBasic
-----------------------------
=> Download
=> Tutorials
=> Wish List
-----------------------------
Support
-----------------------------
=> General Discussions
=> Installation
=> ScriptBasic Examples w/source
=> Debugger
=> Source
=> Documentation
-----------------------------
Extension Modules
-----------------------------
=> Extension Modules
===> DLLC
===> DVM
===> Curl
===> mxml
===> IUP
===> CGI
===> MySQL
===> ODBC
===> Berkeley DB
===> PSQL
===> GSL
===> Rlib
===> GTK-Server
===> CIO
===> NT
===> DYC
===> ZLIB
===> RE
===> HASH
===> GD
===> MT
===> T
===> DBG
===> SQLite
===> SBXML
Loading...