All I want to do is have an a form where users can input their email address and then the email address will be stored in a .txt file in my directory. My question is at the end the tutorial gives some lines of code that looks like this:
I have no experience with cgi, so is all I do save a .txt file as .cgi and name it myform, and then place it in my directory. And then I replace server.com with the address of my site?
I don’t have a .cgi file or anything in my directory. So is the file going to automatically make a .txt file and start adding the addresses? Also, is there a way to do this without cgi? Can I just have the variable sent to a .txt file in my directory?
do you have access to PHP on your server? It’s quite easy to write to a file or create a new file using PHP. If you do have access to it, let me know and we can discuss the details.
Yes I do have PHP access. Thanks for your help. I have looked all over the internet and I can’t find what I need. All I want is an input box that stores a variable in an outside file. In this case, the variable will be email addresses. This way, I can go to the outside file and just have the long list of addresses that I can move to my E-mail.
To do this you need to create a dynamic text box and give it a variable name (not an instance name!). Name it something like e-mail. Now, create some sort of submit button and attach the following code to it (assuming you’re using MX):
*If $_GET isn’t working for you, don’t fret. Use $HTTP_POST_VARS[email] instead.
As you can see, it’s quite a simple process. I had problems when I tried this on my host. They told me fwrite() wasn’t permitted. If this is the same with your host, simply add a shebang line to the path of php on the host and you will probably be able to access fwrite(). I can’t guarantee that it will work but I know it did for me.
Actually Flash has no part in thr writing process. It is simply defining the value of the email address that will be written to a file by the PHP script. Flash just passes that value to the write.php file. If Flash could write to files, there would be no need for PHP in this case.