E-card program with PHP and MySQL

Source: Internet
Author: User
Tags php and php and mysql strlen table name

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 when determining that you have not logged on to else.
{
Echo "<div align = 'left'> Your name: </div>
</Td>
<Td width = '000000'>

<Input type = 'text' name = 'username'>
</Td>
</Tr>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.