Step 1: first make the following form: (Note: the php program is added to this form)
<Form method = "post" action = "mailtocard. php" name = "card" onSubmit = "return card_Validator (this)">
<Table width = "450" border = "0" cellspacing = "0" cellpadding = "0" align = "center">
<Tr>
& Lt; td valign = "top" width = "143" & gt;
<Input type = "radio" name = "inout" value = "newyear" checked>
</td>
& Lt; td width = "170" & gt;
<Input type = "radio" name = "inout" value = "newyear2_2">
</td>
& Lt; td width = "137" & gt;
<Input type = "radio" name = "inout" value = "newyear3_3">
</td>
</Tr>
<Tr>
<Td valign = "top" colspan = "3">
<Textarea name = "text" rows = "7" cols = "60" wrap = "VIRTUAL"> Hello friend:
</Textarea>
</Td>
</Tr>
<Tr>
<Td valign = "top" colspan = "3">
<Select name = "music">
<Option selected> -- card background music -- </option>
<Option value = "101marry. mid"> One Thousand and One Nights </option>
<Option value = "canyon. mid"> canyon </option>
</Select>
<Input onclick = playSound () type = button value = "Try Music">
</Td>
</Tr>
<Tr>
<Td valign = "top" colspan = "3"> </td>
</Tr>
<Tr>
<Td valign = "top" colspan = "3">
<Table width = "370" border = "0" cellspacing = "0" cellpadding = "0" align = "center" class = "p11">
<Tr>
& Lt; td width = "108" & gt;
<?
If (strlen ($ g_username)> 1)
{
// Determine whether to log on. If you have logged on to the system, you do not need to enter the name and Email.
$ Db = mysql_connect ("localhost", "root ","");
$ Result = mysql_db_query ("Database Name", "select email, http from database table name where username = $ g_username ");
$ Row = mysql_fetch_array ($ result );
$ Bbs_email = $ row [email];
Echo "<div align = left> your name: </div>
</Td>
<Td width = 342>
$ G_username
<Input type = hidden name = username value = $ g_username>
</Td>
</Tr>
<Tr>
<Td width = 108>
<Div align = hidden> your Email: </div>
</Td>
<Td width = 342>
$ Bbs_email
<Input type = hidden name = email value = $ bbs_email>
";
}
// If (strlen ($ g_username) <0)
Else // you need to enter your name and Email to determine if you have not logged on to else.
{
Echo "<div align = left> your name: </div>
</Td>
<Td width = 342>
<Input type = text name = username>
</Td>
</Tr>
<Tr>
<Td width = 108>
<Div align = left> your Email: </div>
</Td>
<Td width = 342>
<Input type = text name = email> ";
}
?>
</Td>
</Tr>
<Tr>
& Lt; td width = "108" & gt;
<Div align = "left"> friend name: </div>
</Td>
& Lt; td width = "342" & gt;
<Input type = "text" name = "f_name">
</Td>
</Tr>
<Tr>
& Lt; td width = "108" & gt;
<Div align = "left"> friend Email: </div>
</Td>
& Lt; td width = "342" & gt;
<Input type = "text" name = "f_email">
</Td>
</Tr>
<Tr>
<Td width = "108"> </td>
& Lt; td width = "342" & gt;
<Input type = "button" name = "submit" value = "preview" onclick = "preview ()">
<Input type = "submit" name = "submit" value = "send">
<Input type = "reset" name = "Submit3" value = "">
Step 2: preview
<?
If (submit = "preview ")
{
Switch ($ new)
{
Case "newyear ":
$ New = "newyear.gif ";
Break;
Case "newyear2_2 ":
Optional querymedianewyear2_2.gif;
Break;
Case "newyear3_3 ":
Optional querymedianewyear3_3.gif;
Break;
}
}
?>
<Html>
<Head>
<Title> e-cards </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
</Head>
<Body bgcolor = "# eeeeee">
<Form method = "post" action = "mailtocard. php">
<Table width = "497" border = "0" cellspacing = "0" cellpadding = "0" align = "center" height = "310">
<Tr>
<Td colspan = "2">
<Div align = "center">
<? Echo "
</Div>
</Td>
</Tr>
<Tr>
& Lt; td width = "317" valign = "top" & gt;
<P> <font size = "3" color = "# FF0066"> dear friend, </font> <br>
<Br>
<Font size = "2" color = "# 3333FF">
<? Echo $ text;?>
</Font> </p>
</Td>
& Lt; td width = "180" valign = "top" & gt;
<Div align = "right">
<Table width = "90%" border = "0" cellspacing = "0" cellpadding = "0">
<Tr>
<Td>
<P> <font size = "3" color = "# FF0066"> sent to: </font> <font size = "2"> <br>
</Font> </p>
<P> <font color = "# 3300CC" size = "2"> <? Echo $ f_name;?>
<Input type = hidden name = f_name value = $ f_name>
</Font> </p>
<P> <font size = "3" color = "# FF0066"> friends: </font> </p>
<P> <font size = "2" color = "# 3300CC">
<? Echo $ g_username;?>
<Input type = hidden name = username>
<Input type = hidden name = f_email value = "$ femail">
<Input type = hidden name = email>
</Font> </p>
</Td>
</Tr>
</Table>
</Div>
</Td>
</Tr>
<Tr>
<Td colspan = "2" valign = "top">
<Div align = "center">
<Input type = "submit" name = "submit" value = "send">
<Input type = "button" onclick = "javascript: window. close ()" name = "close" value = "close window">
</Div>
</Td>
</Tr>
</Table>
</Form>
</Body>
</Html>
Step 3: send greeting cards
<?
If (submit = "send ")
$ Mainurl = "http://lyjrich.oso.com.cn/card"; // The Home Directory URL of the greeting card file
$ Dataurl = "$ mainurl/store"; // the URL of the generated greeting card.
$ Userip = getenv ("REMOTE_ADDR ");
$ Daten = date ("m month D day H point I ");
$ Roundno = date ("mdHis ");
$ Fileno. = $ roundno. ". html ";
$ Fileurl = $ dataurl. "/". $ fileno; // The URL for storing the generated Greeting Card
$ Subject = "greeting cards mailed to you by a friend ";
$ Content = eregi_replace ("<br>", "", "$ text ");
$ T_body. = "************************************** ";
$ T_body. = $ f_name. "Hello :";
$ T_body. = $ g_username. "sent you a greeting card from the http://lyjrich.oso.com.cn. ";
$ T_body. = $ g_username. "The message". $ text ."";
$ T_body. = "Please click http://lyjrich.oso.com.cn/card". $ fileurl. "To enjoy this card ";
$ T_body. = "the greeting card is saved for up to one month. ";
$ T_body. = "************************************";
$ T_body. = "sending time $ daten ";
$ T_body. = "************************************** ";
$ T_body. = "free e-cards are provided by the your web site ";
$ T_body. = "Program Production: lyjrich (http://lyjrich.oso.com.cn )";
Mail ($ f_email, $ subject, $ t_body, "From:". $ email ."");
Echo "<script language =" javascript "> history. back (); alert (" sent successfully. Thank you !! "); </Script> ";
$ Message = "<Head>
<Title> e-cards </title>
<Meta http-equiv = Content-Type content = text/html; charset = gb2312>
</Head>
<Body bgcolor = # eeeeee>
<Table width = 497 border = 0 cellspacing = 0 cellpadding = 0 align = center height = 310>
<Tr>
<Td colspan = 2>
<Div align = center>
</Div>
</Td>
</Tr>
<Tr>
<Td width = 317 valign = top>
<P> & l