Two other possibilities:

You're using PHP < v.5 (no "file_put_contents()").
You have "register_globals" turned off (as it should be--use "$_POST['id']" instead).

BTW, "file_put_contents()" doesn't need "fopen()" or "fclose()". Check the manual.

And turn on error reporting/display.

    file_put_contents (string filename, string data [, int flags [, resource context]])

    first param is filename
    second is the string data (content of the file)
    third param is the flag (in your case is email address)? 😕

    Concat. string:

    $str1 = "Bla";
    $str2 = " more bla ...";
    $concat_ver1_str1_str2 = "{$str1}{$str2}";
    $concat_ver2_str1_str2 = $str1.$str2";
    echo $concat_ver1_str1_str2;
    echo $concat_ver2_str1_str2;

    before working with php function u may check the php manual here.

      file_put_contents("form1.txt", array($_POST['id'], $_POST['email']));

        form1.php

        <html>
        <body>
        <?php
        $filename = 'test.txt';
        if (is_writable($filename)) {
        echo 'The file is writable';
        } else {
        echo 'The file is not writable';
        }
        ?>
        <?php
        $file=fopen("form1.txt","a+") or exit("Unable to open file!");
        echo file_put_contents("form1.txt", '$id', '$email');
        fclose($file);
        ?>

        </body>

        give me a few to reconfigure my stuff...
        </html>

        internal server error

          You might want to read some of the previous posts.

            register_globals is turned off, i have a phpNuke site on this server and don't want comprimised stuff going on there...

            so, how can i bypass that?

              Since register globals if off, you need to:

              use "$POST['id']" instead

              For file put contents:

              first param is filename
              second is the string data (content of the file)
              third param is the flag

              so:

              file_put_contents("form1.txt", array($_POST['id'], $_POST['email']));

              "file_put_contents()" implicitly opens and closes the file, so:

              [it] doesn't need "fopen()" or "fclose()". Check the manual.

              And;

              check the php manual

              As for the "internal server error", that's probably another matter.

              (All quotes are from previos posts in this thread.)

                thank you for your patients in this i'm sure you get newbies like me all the time I'm more of an admin than a programmer... i'm trying to break into programming more and more though... first semester java at University of Cincinnati

                "Premature end of script headers: php-script" is the script error according to the log.

                so the form1.php file now looks like this.
                form1.php

                <html>
                <body>
                <?php
                $filename = 'form1.txt';
                if (is_writable($filename)) {
                echo 'The file is writable';
                } else {
                echo 'The file is not writable';
                }
                ?>
                <?php
                file_put_contents("form1.txt", array($POST['id'], $POST['email']));
                // file_put_contents("form1.txt", array($POST['id'], $POST['email']));

                ?>

                </body>
                </html>

                i no longer get the internal server error, and the return doesn't display anything, which i expecting to see either the file is or is not writable line but it's not doing that either...

                so, is there possibly something wrong in the html?
                form1.html

                <html>
                <head>
                <title>testing</title>
                </head>
                <body>
                <form id="form1" action="form1.php" method="post">

                	ID:
                	<input type="text" name="id" value="ID" />
                	<br />
                	Email:
                	<input type="text" name="email" value="email" />
                	<br />
                	<input type="submit" value="Submit your application" />
                </form>

                </body>
                </html>

                  The html looks ok, and so does the php. I may be missing something, but it should be echoing one of the lines.

                  Your file-writing code is outside the "if" block, so it will try to write in either case. Move that code to the same clause as "file is writable".

                    [Tue Jul 18 07:50:15 2006] [error] [client <MY IP>] Premature end of script headers: php-script, referer: http://www.mindimaging.com/form1/form1.html

                    seems like it's in the html, but i can't see anything wrong with this...

                    form1.html
                    <html>
                    <body>
                    	<form id="form1" action="form1.php" method="post">
                    
                    	ID:
                    	<input type="text" name="id" value="ID" />
                    	<br />
                    	Email:
                    	<input type="text" name="email" value="email" />
                    	<br />
                    	<input type="submit" value="Submit your application" />
                    </form>
                    
                    </body>
                    </html>
                    ---------------------------------------------------------------
                    form1.php
                    <html>
                    <body>
                    <?php
                    $filename = 'form1.txt';
                    if (is_writable($filename)) {
                       echo 'The file is writable';
                       file_put_contents("form1.txt", array($_POST['id'], $_POST['email']));
                    } else {
                       echo 'The file is not writable';
                    }
                    ?> 
                    
                    </body>
                    </html>
                     

                      This short article might shed some light (it didn't for me 🙂). Also, just a stab, check the mime type settings in your server configs.

                        <meta http-equiv="Content-Type" content="text/html\n\n; charset=iso-8859-1"> was added into a header for the form1.php file.

                        Request, can you try these two files on your server, and tell me if it freakin works?

                          Get the '\n\n' out of there:

                          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

                            It works fine for me, on both Windows and Linux.

                              could someone try this stupid code, i swear this shouldn't be this troublesome.

                                if that's the case then i must have a configuration issue on the server? would that be your assumption?

                                  Man, you edit fast...

                                  I would assume a config problem, yes. Maybe someone else can help you better with that.

                                    odd that this code works

                                    <html>
                                    <body>
                                    
                                    
                                    <form action="action.php" method="post">
                                     <p>Your name: <input type="text" name="name" /></p>
                                     <p>Your age: <input type="text" name="age" /></p>
                                     <p><input type="submit" /></p>
                                    </form>
                                    </body>
                                    </html>
                                    
                                    <html>
                                    <body>
                                    <p>
                                    Hi <?php echo $_POST['name']; ?>.
                                    You are <?php echo $_POST['age']; ?> years old
                                    </p> 
                                    </body>
                                    </html>