In the previous messsage you got the source of postcard.php
BElow is the source of postcard.tpl:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<title>Phorum Builder</title>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="530" align="center" border="0" cellspacing="0" cellpadding="0" bgcolor="#e8f8ff">
<tr>
<td><img src="images/[IMAGE]"></td>
<td>This is a message to <a href="mailto:[TO_EMAIL]">[TO]</a>
from <a href="mailto:[FROM_EMAIL]">[FROM]</a>
<br><br><br>
[MESSAGE]
</tr>
</table>
</body>
The whole thing works from a database:
create table postcards ( image varchar(150), to varchar(50), to_email varchar(50), from varchar(50), from_email varchar(50), message text, id varchar(9), PRIMARY KEY (id));
The card is sent using sendcard.php:
<head>
<title>Send a postcard!</title>
</head>
<body bgcolor="#ffcc00">
<?php
if ($send) {
$id = time();
include ("include/db_setup.php");
include ("include/postcard_setup.php");
$query = ("INSERT INTO postcards VALUES ('$image', '$to', '$to_email', '$from', '$from_email', '$message', '$id')");
pg_exec ($conn,$query);
mail ("$to_email", "$youhavecard_subject", "$youhavecard", "From: $from_email");
echo ("Thank you, your card has been sent.");
}
else {
echo ('<form>
To:
<input type="text" name="to">
<br>
To_Email:
<input type="text" name="to_email">
<br>
From:
<input type="text" name="from">
<br>
From_Email:
<input type="text" name="from_email">
<br>
Message:
<input type="textarea" name="message">
<br>
<input type="hidden" value="<?php echo ($image); ?>">
<input type="submit" name="send" value="Submit">
</form>');
}
?>
</body>
db_setup:
<?php
$dbname="xxxxx";
$user="xxxxxxx";
$host="db.xxxxx.com";
$password="xxxxxx";
$conn = pg_connect("dbname=".$dbname." host=".$host." user=".$user." password=".$password);
?>
postcard_setup:
<?php
The subject of the message sent to the receipient
$youhavecard_subject = "$from has sent you a postcard!";
This is the message sent to the recipient of the card
$youhavecard = "Hello, you have a postcard!
You can find it at http://www.narrowgauge.f2s.com/postcard.php?id=$id
Narrow Gauge on the web";
The subject of the message sent to the sender
$cardreceived_subject = "Thank you for sending a postcard!";
This is the message sent to the sender to notify him that the card has been received.
$cardreceived = "Hi,
Thank you for sending a postcard. $to picked it up at ((Add date!)) GMT.
Please keep checking this site for updates!";
?>
That's all the source code!