Any problem with PHP can be disscused here
Kaky
Posts: 274 Joined: Tue Apr 18, 2006 7:43 pm
Post
by Kaky » Thu May 11, 2006 2:19 pm
I wonder if it could be possible that someone onters his mail and an auto formatted mail comes to him (so i do naot have to write him anything) for example you know something like "if you like this site why not tell your friend ......."
If somenone could post a script for it i would be wery thankfull.
A funny picture -------> me , myself and i (too much for this world)
Flipper3
Posts: 353 Joined: Tue Feb 28, 2006 12:34 am
Post
by Flipper3 » Thu May 11, 2006 9:15 pm
I would like this as well or maybe an email validation script!
lokesh
Posts: 26 Joined: Sat May 13, 2006 11:40 am
Post
by lokesh » Sat May 13, 2006 2:46 pm
Hope I understood what you are looking for...a person enters his mail id and submits it, then a mail with pre-defined content is sent to him automatically without you doing anything.
Here is a simple one,
Code: Select all
<?php
if($submitform) {
$email = $_GET['email'];
$subject = "Thanks for visiting [your website]";
$message = "
Howdy!,
Your custom message here
--
-Regards,
[your name]
This email was automatically generated.
Please do not respond to this email.";
if(!mail($email,$subject,$message, "FROM: yourname <youremail>")) {
echo("Error processing your request");
}
else {
echo "Thank you. Your email has been added to our database.";
}
}
else {
?>
<html><body>
<form action="" method="get">
Email:<input type="text" name="email">
<input type="submit" value="Submit" name="submitform">
</form>
</body></html>
<?
}
?>
Hope this is what you were looking for.
Kaky
Posts: 274 Joined: Tue Apr 18, 2006 7:43 pm
Post
by Kaky » Sun May 14, 2006 8:57 am
yes it is what i was hoping to get (how many forms should i make?)
A funny picture -------> me , myself and i (too much for this world)
lokesh
Posts: 26 Joined: Sat May 13, 2006 11:40 am
Post
by lokesh » Sun May 14, 2006 12:05 pm
The code posted above has both the form and the script to send mail, just save it as a single file. Just a single form is enough...
Kaky
Posts: 274 Joined: Tue Apr 18, 2006 7:43 pm
Post
by Kaky » Sun May 14, 2006 12:43 pm
thx man i am a total noob in html and do not know a single bit of php so i was a bit lost
A funny picture -------> me , myself and i (too much for this world)