I am making (or trying to make) a mailing list form for my web site. It is supposed to write the email addresses to the file but it isnt working any help would be GREATLY helpful THANKS

1}

<html>
<body>
<form action="write1.php" method="POST">
What is your E-MAIL ADRESS <input type="text" name="mail" />
<input type="submit" />
</form>

</body>
</html>


2}
<html>
<body>
<?php
<script language="php">
$filename = 'test.txt';
$fp = fopen($filename, "a");
$write = fputs($fp, $_POST["mail"]);
fclose($fp);
</script>
<strong>GOOD</strong>
</body>
</html>

$write = fputs($fp, $_POST["mail"]);

I guess that's the problem, try:

fputs($fp, $_POST["mail"];

<script language="php"> </script>

I don't think you need this, but where's the ?> ?


Michael

THANK YOU SO MUCH sorry about the wait but my server was down :sad:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.