Skip to content

Instantly share code, notes, and snippets.

@KevinRagsdale
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KevinRagsdale/7ed704897b6f98f45ebf to your computer and use it in GitHub Desktop.
Save KevinRagsdale/7ed704897b6f98f45ebf 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 (Using 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/4a560b7e43e9d565dde3.js"></script>
<hr />
<script src="https://gist.github.com/KevinRagsdale/7ed704897b6f98f45ebf.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