Mixing HTML & LC
Posted: Fri Feb 10, 2023 9:49 pm
I've been playing with Livecode server recently, but what seems obvious to me , or would work in livecode, doesn't appear to work in webpage.
Example - login page
It posts username and password to another LC page that does it's bit, and if invalid returns user back to login page with an error ie: login.lc?error=1 (this part all works fine and as expected)
I'm trying this in the location i wish the error to appear
<?lc
Global gErrText
If gErrText is not empty then
Put "<div class="alert alert-danger" role="alert">"
Put "<strong>"&gErrtext&"</strong>"
put "</div>"
end if
?>
This line" Put "<div class="alert alert-danger" role="alert">" (or any line with mention of class) results in a livecode error
file "E:/SERVER/Apache24/htdocs/login.lc"
row 76, col 32: put: preposition must be 'before', 'into' or 'after' (alert)
row 76, col 32: if: error in command (alert)
row 76, col 32: script: bad statement (alert)
How do I use html code with put statements, other than basic <p> <strong> etc tags ? Or how to make them HTMl/lc friendly without manual dibbling of html string.
Thanks
Example - login page
It posts username and password to another LC page that does it's bit, and if invalid returns user back to login page with an error ie: login.lc?error=1 (this part all works fine and as expected)
I'm trying this in the location i wish the error to appear
<?lc
Global gErrText
If gErrText is not empty then
Put "<div class="alert alert-danger" role="alert">"
Put "<strong>"&gErrtext&"</strong>"
put "</div>"
end if
?>
This line" Put "<div class="alert alert-danger" role="alert">" (or any line with mention of class) results in a livecode error
file "E:/SERVER/Apache24/htdocs/login.lc"
row 76, col 32: put: preposition must be 'before', 'into' or 'after' (alert)
row 76, col 32: if: error in command (alert)
row 76, col 32: script: bad statement (alert)
How do I use html code with put statements, other than basic <p> <strong> etc tags ? Or how to make them HTMl/lc friendly without manual dibbling of html string.
Thanks