btw i have a test.php which has the forms and the iframe(board.php) and this gets the info and stores it in the variables, then i got action.php which outputs the data...... thanks

    so u guys can help a newbie, heres the data in the files:

    test.php:

    	<form action="action.php" method="POST" target="board">
    		<div align="center">
    			<iframe src="board.php" name="board" width="150" height="200" marginwidth="0" marginheight="0"></iframe>
    			<br>
    			<input type="text" name="name" value="Your Name"><br>
    			<input type="text" name="mail" value="Your E-Mail"><br>
    			<input type="text" name="message" value="Message"><br>
    			<input type="submit" value="Shout&nbsp;Out!"></div>
    	</form>

    action.php:

    <a href="mailto:<?php echo $_POST["mail"]; ?>"><?php echo $_POST["name"]; ?></a>: <?php echo $_POST["message"]; ?>

    board.php:
    its empty 🙁

      like i said before read the manual.. and go and check out tuts with text databases at spoono. or even search it on the web at google...

      fwrite - http://www.php.net/manual/en/function.fwrite.php
      fread - http://www.php.net/manual/en/function.fread.php
      fclose - http://www.php.net/manual/en/function.fclose.php
      fopen - http://www.php.net/manual/en/function.fopen.php

      i dont think anything is gonna help you there but to remember that you must chmod your text file 777 if you upload it onto a non-windows server

        YES! i got it to write to a txt file, but for some reason its not showing the variables the right way

          heres my action.php now

          <?php
          $filename = 'messages.txt';
          $somecontent = '<a href="mailto:echo $_POST["mail"];">echo $_POST["name"];</a >: php echo $_POST["message"];\n';
          
          // Let's make sure the file exists and is writable first.
          if (is_writable($filename)) {
          
          // In our example we're opening $filename in append mode.
          // The file pointer is at the bottom of the file hence 
          // that's where $somecontent will go when we fwrite() it.
          if (!$fp = fopen($filename, 'a')) {
               print "Cannot open file ($filename)";
               exit;
          }
          
          // Write $somecontent to our opened file.
          if (!fwrite($fp, $somecontent)) {
              print "Cannot write to file ($filename)";
              exit;
          }
          
          print "Thanks for the submission!";
          
          fclose($fp);
          
          } else {
              print "The file $filename is not writable";
          }
          ?>

          i dont think its detecting the variables, or im displaying them wrong.

            i think the problem is my message.txt didnt have

            <?php ?> in it, i added it but it keeps adding the messages below this, how can i make add it in between?

              Now this may not help you.. But if your text file.. is not chmodded then it wont work.. Now im not exactly sure what do with it maybe... try /n as a new line.. But as i said before text databases and the fread etc functions im not great at

                i got it to work, i just need it to fwrite to the TOP of the text file... which i dunno how to

                  open the file, [man]rewind/man. The pointer is then at the start of the file and fwrite() will write to the top of the file.

                    Write a Reply...