In order to do this, you need a string to store your PHP page and
a function that I will list at the bottom of the page for you to put in
a module. This code is written in VB.NET
Public Sub CreatePage(ByVal HTMLTitle As String, ByVal HTMLText As String, ByVal HTMLFileName As String)
Dim strFile As String
' ----------------------
' -- Prepare String --
' ----------------------
strFile = ""
' --------------------
' -- Write Starter --
' --------------------
strFile = "<html>" & vbNewLine
strFile = strFile & "<head>" & vbNewLine
strFile = strFile & "<title>" & HTMLTitle & "</title>" & vbNewLine
strFile = strFile & "</head><body>" & vbNewLine
strFile = strFile & HTMLText & vbNewLine
strFile = strFile & "</body></html>"
SaveTextToFile(strFile, "C:\" & HTMLFileName & ".html")
End Sub
'///////////////////////////////////////////////////////////////////////////
'// Call this sub using: Call CreatePage("Welcome", "Hello world! This is a dynamic page.", "index")
'///////////////////////////////////////////////////////////////////////////
---------------------------------------------------------------------------
Okay! Now we're done with the sub for creating the page, this is the
only other snippet of code you will need, this needs to go into a
module of your program.
---------------------------------------------------------------------------
Public Function SaveTextToFile(ByVal strData As String, _
ByVal FullPath As String, _
Optional ByVal ErrInfo As String = "") As Boolean
Dim Contents As String
Dim Saved As Boolean = False
Dim objReader As IO.StreamWriter
Try
objReader = New IO.StreamWriter(FullPath)
objReader.Write(strData)
objReader.Close()
Saved = True
Catch Ex As Exception
ErrInfo = Ex.Message
End Try
Return Saved
End Function
---------------------------------------------------
As you can see, the code has a wide range of uses,
such as taking old INI databases from your applications
and being able to turn them into a useable webpage.
Just take the strFile and add onto it with any HTML code
or even PHP, all you'd have to do is change the ending
on the save function inside the CreatePage sub.
Right now I'm working on a program that takes a simple
INI database, a couple arrays, and I'm able to make
a program that updates an online roster with the click
of a button. So instead of copying and pasting 800 times
I'm going back to gaming for an hour.

