PDA

View Full Version : Completely lost, need to create a register thingy...



rdoroana
February 25th, 2004, 05:47 PM
I need some help. First of all, I would like to know if creating something like this is possible:

A simple page with the following things:

Account Name: [TEXT FIELD]
Account Pass: [TEXT FIELD]
E-mail: [TEXT FIELD]

Submit Button

Upon clicking submit a txt file would be created with the inputed info like this:

(Account Name),(Account Pass),(E-mail)

That file would be created in a specified folder on my computer. The page would also be run from a personal FTP server on my computer.

So, is this crazy thing possible?
Thanks in advance :)

blindlizard
February 25th, 2004, 07:20 PM
You need to run it from a web server not an FTP server. FTP can't do any logic, only get and send files.

If you are running Windows 2K or XP Pro then you have a web server you can use. If you are running any other version of windows then you need to look for Personal Web Server from MS. I think it is free. If you are running any version of Linux I am sure there is a bundled webserver and if you are running Mac, you are on your own I have no idea what to use there. :)

rdoroana
February 25th, 2004, 07:39 PM
I'm running XP Home but getting a Web Server isn't a problem.
Now I need help on the main thing, how can I create something like that?

blindlizard
February 25th, 2004, 08:21 PM
Here is an ASP way (assuming you go with Personal web server)
Putt the code below into a text file and call it default.asp
Put it in the wwwroot folder of PWS or IIS and run it by putting http://loclhost/default.asp in your browser
Fill in the 3 fields and it will be saved to a file called MyFile.txt on your c drive.
You need to make sure that the IUSR_Macinename account has rights to write to c:\


<%
Const fsoForAppend = 8

Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

'Open the text file
Dim objTextStream
Set objTextStream = objFSO.OpenTextFile("C:\MyFile.txt", fsoForAppend, True)

'write
objTextStream.WriteLine Request("AccName") & "," & Request("AccPass") & "," & Request("Email")

'Close the file and clean up
objTextStream.Close
Set objTextStream = Nothing
Set objFSO = Nothing
%>

<html>
<body>
<form action="default.asp" method="post">
<input type="text" name="AccName">
<input type="text" name="AccPass">
<input type="text" name="Email">
</form>
</body>
</html>