Jump to content

e cards


aslanandbeez

Recommended Posts

Hey, I'm planning oh having some e-cards on a site, the idea is someone picks one of four designs maybe with a radio or checkbox and fills in their name and email address and the recipient's email address and name which along with the picture and a message get sent to them.

 

I have a vague idea about some of the aspects, but can anybody point me in the righ direction of what i might need to do, or better yet a kind of tutorial?

 

Anybody helping me will earn some serious karma points

Link to comment
https://forums.phpfreaks.com/topic/102952-e-cards/
Share on other sites

Well you've got it planned out pretty good!

 

How much do you know?

 

You can get the results from the form with the $_GET['form_name'] or $_POST['form_name'] variables, and replace 'form_name' with the name of your form.

 

 

You can send mail with the mail() function

 

http://us2.php.net/manual/en/reserved.variables.get.php

 

http://us2.php.net/manual/en/reserved.variables.post.php

 

http://us3.php.net/manual/en/function.mail.php

Link to comment
https://forums.phpfreaks.com/topic/102952-e-cards/#findComment-527405
Share on other sites

<?php
$to      = $_POST['to'];
$subject = "Check out this E-Card you received from ".$_POST['sender_name'];
$message = "your message here";
$headers = "From:".$_POST['sender_name']."<".$_POST['from_email'].">\r\n
    Reply-To: ".$_POST['sender_name']." \r\n
    X-Mailer: PHP/". phpversion();

mail($to, $subject, $message, $headers);
?>

Link to comment
https://forums.phpfreaks.com/topic/102952-e-cards/#findComment-528066
Share on other sites

Id suggest gathering as much information as u can about basic principles, like variables, superglobals, forms, mail etc etc, before u start on a real project. It is a pretty easy one but u need to have some solid understanding of the basics before working on it.

 

The above code will work, only that u need to add the image background and send the email as html by adding a few extra headers.

Link to comment
https://forums.phpfreaks.com/topic/102952-e-cards/#findComment-528068
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.