Hey all, Im trying to create an unsubscribe page using PHP I tryed all the tutorials I can find, and all the pre made scripts, but Im not geting this, I cant seem to pass the form data to the PHP page then to the file.
my output looks like this on the php page
Were sorry to see you leave rememail
and the text remove.rtf shows
rememail
no matter what I put in the input field
heres the HTML page
<html>
<head>
<title>Unsubscribe from our newsletter</title>
</head>
<body>
<form action="remove.php" method="post">
<center><table>
<tr>
<td><b>Enter the email address to remove.</b></td><br>
<br>
</tr>
<tr>
<td><input type="text" name="rememail" size="30"></td>
</tr>
</table>
<input type="submit" value="Unsubscribe">
</center>
</form>
</body>
</html>
and the PHP file
<html>
<?php
$filename = 'remove.rtf';
$address = 'rememail'; <--- I believe my issue is here
if (is_writable($filename)) {
if (!$fp = fopen($filename, 'a')) {
print "There was an error during saving please go back and resubmit";
exit;
}
if (!fwrite($fp, "$address \n") {
print "There was an error during saving please go back and resubmit";
exit;
}
print "Were sorry to see you leave $address";
fclose($fp);
} else {
print "There was an error during saving please go back and resubmit";
}
?>
</html>
my output looks like this on the php page
Were sorry to see you leave rememail
and the text remove.rtf shows
rememail
no matter what I put in the input field
heres the HTML page
<html>
<head>
<title>Unsubscribe from our newsletter</title>
</head>
<body>
<form action="remove.php" method="post">
<center><table>
<tr>
<td><b>Enter the email address to remove.</b></td><br>
<br>
</tr>
<tr>
<td><input type="text" name="rememail" size="30"></td>
</tr>
</table>
<input type="submit" value="Unsubscribe">
</center>
</form>
</body>
</html>
and the PHP file
<html>
<?php
$filename = 'remove.rtf';
$address = 'rememail'; <--- I believe my issue is here
if (is_writable($filename)) {
if (!$fp = fopen($filename, 'a')) {
print "There was an error during saving please go back and resubmit";
exit;
}
if (!fwrite($fp, "$address \n") {
print "There was an error during saving please go back and resubmit";
exit;
}
print "Were sorry to see you leave $address";
fclose($fp);
} else {
print "There was an error during saving please go back and resubmit";
}
?>
</html>