[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
use a gambas web cgi in a phpBB forum
[Thread Prev] | [Thread Next]
- Subject: use a gambas web cgi in a phpBB forum
- From: Bruce Steers <bsteers4@xxxxxxxxx>
- Date: Thu, 27 Nov 2025 17:50:34 +0000
- To: Gambas Mailing List <user@xxxxxxxxxxxxxxxxxxxxxx>
Hi all. I am trying to make a gambas highlighter in a web cgi script.
I am having problems with loosing the line feeds when using Request.Query
in a phpBB custom bbcode so i need to use POST method instead.
on the forum side i can use javascript (and possibly php) in custom bbcode.
the cgi simply reads the Query string or Request.ContentLength and runs it
through gb.highlight.
looks like this...
Public Sub MakeHtml() As String
Dim iPos, iPos2 As Integer
Dim sMode As String = "gambas"
Dim s As String = FromUrl(Request.Query)
If s Begins "mode=" Then ' check for mode= in Query string
iPos = InStr(s, "=")
iPos2 = InStr(s, "&")
If Not iPos2 Then iPos2 = s.Len
sMode = Mid(s, iPos + 1, iPos2 - iPos - 1)
s = Mid(s, iPos2 + 1)
Endif
' if string was not passed as Query then read POST
If Not s And If Request.ContentLength Then s = Read Request.ContentLength
' write a table with gambas highlighted html.
Print "<table width=100% height=100% border=1 cellpadding=10><tr
height=3em><th height=3em align=left>" & sMode & " code</th></tr><tr><td>"
Print TextHighlighter[sMode].ToHTML(s)
Print "</td></tt></table>"
End
I cannot get it to work though :(
My LFs are getting stripped :(
i can only add the text in the url and i think it needs to be a POST method
instead but i can't figure it out.
My phpBB custom code is this..
<iframe width=100% height=200px% src="
http://138.68.116.47/cgi-bin/GambasHighlight.gambas?{TEXT}">
</iframe>
that gives what the attached picture shows.
but it needs to be something like.
<script>
open "http://138.68.116.47/cgi-bin/GambasHighlight.gambas"
HTTP POST {TEXT}
Write response to page
</script>
Any advice on how to POST text to a cgi from javascript or php and write
the data would be appreciated?
Thanks all
BruceS
Attachment:
Untitled.jpg
Description: JPEG image
| Re: use a gambas web cgi in a phpBB forum | Lee <t.lee.davidson@xxxxxxxxx> |