使用VB6创建.php或.txt文件

So I'm trying to finish up my website, but since it has a lot of pages I want to speed up the process.

Every post I make needs a .SQL file with the data that will later be used in the .php file to fill everything, now, what I want to do is fill out the info on a VB6 form so that it'll put the data on my database and create a .php file with the given text (that will include all html and php code as well as the variables for every specific post) or a .txt file so I can later just change its extension.

How could I do this?

I'm sorry if I didn't express myself well and thanks in advance, cheers!

EDIT: I know I could do it with just getting the data from my database and having a single dynamic php file, but trust me, for what I need it's better having different files.

Also yes, I meant by ".SQL file" that it'll be just a row in my database.

So basically what I need is to write a certain text on a .txt file (preferably save it with the .php extension) and also for the program to write the data on my database (I already did that part).

Again, sorry for the poor explanation.

A better way to do what you want is to create a form handler (which wont be visible). And the form handler will take your form data and instantiate it (create/update/delete) form the rows in your SQL DB.

Additionally you can upload the handler as required via your vb6 application and REMOVE it after your done with the updates to your SQL DB.

Also if you have more than row that you wish to create/update/delete, then you could recursively send the form data to your Form handler.

Pass your data in a generic HTML form which you ought ot be able to create dynamically on the fly using plain text.

This approach will work for strings and numbers but not for images which usually need to be chunked.

Once your handler has processed the request it can redirect you to a "Success.html" or "Failed.html" page so you know it if succeeded or not.

Pseudo code for HANDLER.ASPX or HANDLER.PHP:

If formdata is valid
  try
    create/update/delete row in SQDB
    redirect to success.html?action=create or update or delete
  catch
    redirect to failed.html?errorid=12345
  end try
else
  redirect to failed.html?errorid=12345
end if

HTML form script (you will generate this in vb6 in your vb code):

<form action="myhandler.aspx" method="post">
    <input type="text" id="recordId" value="123" />
    <input type="text" id="firstname" value="Bob" />
    <input type="text" id="lastname" value="Smith" />
    <input type="text" id="Street" value="123 high lane" />
    <input type="text" id="District" value="Moss Side" />
    <input type="text" id="City" value="Manchester" />
</form>