RE: [HELP] Website Functions! 12-15-2013, 02:02 PM
#3
The contact form could be done like this:
Edit: Confirmed Working
The subscribe function could also be solved using a database.
Here is an example of the function to write to a file:
Edit: Confirmed Working
PHP Code:
<?php
$to = 'yourmailaddress here';
$subject = 'Contact Form:' . $their_name;
$message = $user_message_input;
$headers = 'From: ' . $submitted_mail . "\r\n" .
'Reply-To: ' . $submitted_mail . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>The subscribe function could also be solved using a database.
Here is an example of the function to write to a file:
PHP Code:
<?php
$user_input = "mymail@mail.com" . ";";
echo $user_input;
$file = fopen("maillist.txt","a");
echo fwrite($file,$user_input) or die("Write error!");
fclose($file);
?>
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)