ScriptBasic
July 31, 2010, 06:28:34 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
ScriptBasic
>
ScriptBasic Command Line Interpreter
>
Language - Programming Help
>
How to print html code?
Pages: [
1
]
« previous
next »
Print
Author
Topic: How to print html code? (Read 341 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: 261
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
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Open Forum
-----------------------------
=> Round Table
=> What's New
-----------------------------
ScriptBasic
-----------------------------
=> Download
=> Tutorials
=> Wish List
-----------------------------
ScriptBasic Command Line Interpreter
-----------------------------
=> General Discussions
=> Installation
=> Language - Programming Help
=> ScriptBasic Examples w/source
=> Debugger
-----------------------------
ScriptBasic HTTP Application Server
-----------------------------
=> General Discussions
=> Installation
-----------------------------
ScriptBasic Embedded
-----------------------------
=> General Discussions
-----------------------------
ScriptBasic Extension Modules
-----------------------------
=> Extension Modules
===> IUP
===> CGI
===> MySQL
===> ODBC
===> Berkeley DB
===> PSQL
===> Curl
===> GTK-Server
===> CIO
===> NT
===> DYC
===> ZLIB
===> RE
===> HASH
===> GD
===> MT
===> T
===> DBG
===> BB
-----------------------------
ScriptBasic Source
-----------------------------
=> General Discussions
=> Windows
=> Linux
=> Unix
=> Apple OSX - FreeBSD
Loading...