RE: [HELP] Website Functions! 12-15-2013, 02:09 PM
#5
(12-15-2013, 02:02 PM)CamIce Wrote: The contact form could be done like this:
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 $file_name = 'YourFileContainingEmails.txt'; $mail = $user_input; $file = fopen($file_name, "a"); fwrite($file, $mail . ";"); ?>
I have not yet tested these. Will update the post soon
Sorry, I'm a beginner so I don't quite understand. Let me tell you what I gather,
I have to create a form and put 'action="phpfile.php" '
Or is it that I put this in the head and link each id?
I don't know php. When It comes to sites, I only know html, css and javascript.














![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)