日期:2013-05-16  浏览次数:20518 次

第一步:首先作一个如下面的表单:(注:这个表单里加了php程序)
<form method="post" action="mailtocard.php" name="card" >
<table width="450" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top" width="143">
<input type="radio" name="inout" value="newyear" checked>
<img src="http://www.pushad.com/images/newyear1.gif" width="75" height="75"> </td>
<td width="170">
<input type="radio" name="inout" value="newyear2_2">
<img src="http://www.pushad.com/images/newyear2.gif" width="75" height="75"> </td>
<td width="137">
<input type="radio" name="inout" value="newyear3_3">
<img src="http://www.pushad.com/images/newyear1.gif" width="75" height="75"> </td>
</tr>
<tr>
<td valign="top" colspan="3">
<textarea name="text" rows="7" cols="60" wrap="VIRTUAL">你好朋友:
</textarea>
</td>
</tr>
<tr>
<td valign="top" colspan="3">
<select name="music">
<option selected>--卡片背景音乐--</option>
<option value="101marry.mid">一千零一夜</option>
<option value="canyon.mid">canyon</option>
</select>
<input onclick=playSound() type=button value="试听音乐">
</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>
<td width="108">

<?

if (strlen($g_username) > 1)
{
//判断是否登陆,若已登陆显示姓名及Email,不用填写。
$db=mysql_connect("localhost","root","");
$result=mysql_db_query("数据库名","select email,http from 数据库表名 where username='$g_username'");

$row=mysql_fetch_array($result);
$bbs_email=$row[email];

echo "<div align='left'>您的姓名:</div>
</td>
<td width=342>
$g_username
<input type=hidden name=username value=$g_username>
</td>
</tr>
<tr>
<td width=108>
<div align=hidden>您的Email:</div>
</td>
<td width=342>
$bbs_email
<input type=hidden name=email value=$bbs_email>

";
}
//if (strlen($g_username) < 0)
else //判断没有登陆,需要填写姓名及Email。
{
echo "<div align='left'>您的姓名:</div>
</td>
<td width='342'>

<input type='text' name='username'>
</td>
</tr>
<tr>
<td width='108'>
<div align='left'>您的Email:</div>
</td>
<td width='342'>

<input type='text' name='email'>";
}
?>
</td>
</tr>
<tr>

<td width="108">
<div align="left">朋友姓名:</div>
</td>
<td width="342">
<input type="text" name="f_name">
</td>
</tr>
<tr>
<td width="108">
<div align="left">朋友Email:</div>
</td>
<td width="342">
<input type="text" name="f_email">
</td>
</tr>
<tr>
<td width="108"> </td>
<td width="342">

<input type="button" name="submit" value="预览" >
<input type="submit" name="submit" value="发送">
<input type="reset" name="Submit3" value="重来">
第二步:预览
<?

if (submit=="预览")
{
switch($new)
{