A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

[Help?] 'Lil PHP Question

1k views · started by 323 · · closed
#1
[Help?] 'Lil PHP Question
So this is the part of my index.html file that has the input box:


<form action="http://www.THEURL.com/sent.php" id="mailinglist" method="post">
<input type="text" name="mail" size="40">
</form>


And this is my sent.php file:


<?php
$email = $_POST['mailinglist'];
$date = date("F j, Y");
$all = "Email: " . $email . "\n";
$file = "list.txt";
$handle = fopen($file, "a+");
//mail("MYEMAILADDRESS@gmail.com",$subject,$body);
fwrite($handle, $all);
fclose($handle);
header ("Location: http://www.THEURL.com");
header("Content-type: text/plain");
print_r(htmlspecialchars(print_r($_POST, 1)));
?>


I had tried modding the sent.php file from an FLP but I know I'm doing something wrong >.< I'm pretty sure it has to do with the


$email = $_POST['mailinglist'];


line.

Any help would be greatly appreciated!

Thanks,

~Flareboy323
#2
$email = $_POST['mail'];


That should fix it
#3
Thanks a ton Matt, I'll try it out :D

EDIT: It works, thanks a ton!

/thread
#4
yep, no problem