Skip to content

Instantly share code, notes, and snippets.

@KevinRagsdale
Last active August 29, 2015 14:07
Show Gist options
  • Save KevinRagsdale/3d96a6b5bbd4b493f56d to your computer and use it in GitHub Desktop.
Save KevinRagsdale/3d96a6b5bbd4b493f56d to your computer and use it in GitHub Desktop.
** This DLL is a simple PRG file.
** It will create a web page "on the fly"
** and return it as a string to the
** calling program.
DEFINE CLASS Demo As Session OLEPUBLIC
FUNCTION GetHTML(tcUA As String, tcIP As String) As String
LOCAL lcString As String
TEXT TO m.lcString TEXTMERGE NOSHOW
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Demo (Capturing Request Info)</title>
</head>
<body>
<p>Welcome to my demo!</p>
<p>This page was generated by a multi-threaded DLL created with:</p>
<p><b><<VERSION()>></b></p>
<p><<_VFP.ServerName>></p>
<p>User-Agent: <b><<tcUA>></b></p>
<p>IP Address: <b><<tcIP>></b></p>
<hr />
<script src="https://gist.github.com/KevinRagsdale/a767158b350b00a3a0a2.js"></script>
<hr />
<script src="https://gist.github.com/KevinRagsdale/3d96a6b5bbd4b493f56d.js"></script>
<hr />
<p><em>This page was created <<TTOC(DATETIME())>>.</em></p>
</body>
</html>
ENDTEXT
RETURN m.lcString
ENDFUNC
ENDDEFINE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment