hi ive got this counter code which i would like to modify for use with a mailing list, however im not to good with php scripting yet. 😮
I have a form containing a text box and a submit button. The browser enters their email and submits the form. What i want the code to do is take this entered email address, open a text file cheak if the email is already there (if so close text file) and add it to a list and adding <, > and a , each email is on a new line. e.g.
[B]<[B]>,
[B]<[B]>,
this is my form code:
[CODE]<form method=”POST” action=”http://{$_SERVER[‘HTTP_HOST’]}{$_SERVER[‘PHP_SELF’]}”>
<p style=”margin-top: 1; margin-bottom: 1″><input type=”text” name=”Email” size=”15″ style=”color: #000000; font-family: Arial; font-size: 11px” value=”$value”>
<input type=”submit” value=”Join” name=”B1″ style=”color: #000000; font-family: Arial; font-size: 11px”></p>
</form>
this is the counter code:
[CODE]<?php
//this is our text file if you create a different named file change the script below to reflect this
$counter_file = (“counter.txt”);
//now we open the file
$visits = file($counter_file);
//this increments the counter value by 1
$visits[0]++;
//now we will open the counter file for writing “w”
$fp = fopen($counter_file , “w”);
//put the new count value into the counter file
fputs($fp , “$visits[0]”);
//close the file
fclose($fp);
?>
Help would be much appriciated! ?