I'm learned a bit of php over the weekend. This is the problem: I have Flash sending out a var "address" (an email address) to a php file (mailResponse.php), which then writes that address to a flat file (mailList.txt). (I haven't learned databases yet).

So when I browse thru a server on my PC (I just downloaded the PHPTriad), it works fine. When I put it online, however, it fails.

This is the php code on mailResponse.php:

$mailList=fopen("mailList.txt", "a");
fwrite($mailList, $address);
fclose($mailList);

I have an automatic e-mail responder in the same file that sends out a confirmation e-mail, successfully, so I know that 1) php is being understood and 2) the variable is being caught, on both localhost and the remote host.

I called my host, and they assured me they supported the latest php. I went into my directory and gave permissions to the files so I could write to them. I tried replacing relative addresses with absolute addresses in both Flash and in this simple little routine. I superstitiously got rid of the other mail() code. Nothing works.

What's the difference?

Thanks,

Matt

    Your code is correct. I would hard coding:

    $mailList = "wade@foo.com";

    into your program and run that. See if the file is created.
    a.) If it is then you know that the value address is not getting passed.
    b.) if it is not created then you have permissions wrong on the directory. remember that everyone has to be able to write to that file.
    c.) You may need the full path to the file... In that case your host is pretty anal. Check out eccentrichosting.net we even offer better support to our clients than we do to phpbuilder! lol

    cheers and good luck;
    wade

      Write a Reply...