|
|
|
<?php
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\" ?>\n";
/*
Script: WapMail
Author Marcus S. Xenakis <marcus@xenakis.net>
Feel free to use and modify this script.
Please leave my name in the comments.
Change the variables below to set up the e-mail
Change or add "input" and "postfield" tags to tailor
the script to your needs.
Do not change the "<postfield name="mode" value="1"/>" line
Also change all of the "yourdomain.com" references
to your domain.
*/
$recipient_mail = "webmaster@yourdomain.com";
$recipient_name = "Webmaster";
$sender_name = "WapMail";
$sender_mail = "wapmail@yourdomain.com";
$subject = "News Letter Subscription";
$message = "News Letter Subscription\n\n";
function CheckEmail ($email) {
$error = FALSE;
# -- note first blank is a placeholder
$punctuation = " ~!#$%^&*()+|{}[]:;?<>,/?\\\'\"";
$strpos = strpos($email,"@");
if (!$strpos) {
$error = TRUE;
} elseif (strpos($email,"@",$strpos +1)){
$error = TRUE;
} else {
for ($i = 0; $i < strlen($punctuation); ++$i) {
$error = strpos($email,$punctuation[$i]);
if ($error > 0) {
$test = isset($error);
$error = TRUE;
break;
}
}
}
if (!$error) {
list($user,$domain)= split("@",$email,2);
$arr = explode(".",$domain);
$count = count($arr);
if (strlen($user) < 1) {
$error = TRUE;
} elseif ($count < 2) {
$error = TRUE;
} elseif (strlen($arr[$count-1]) < 2) {
$error = TRUE;
} elseif (strlen($arr[$count-2]) < 2) {
$error = TRUE;
}
}
return ($error);
}
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML
1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
<meta http-equiv="Cache-Control" content="max-age=0" forua="true"/>
</head>
<!-- add a template here if you have one -->
<card id="subscribe1" title="yourdomain.com">
<p>
<b>Newsletter Subscription</b><br/>
<small>
<?PHP if (!$mode): ?>
Please ener information below<br/>
First Name<br/>
<input name="fname" value=""/><br/>
Last Name<br/>
<input name="lname" value=""/><br/>
E-mail Address<br/>
<input name="email" value=""/><br/>
<anchor title="Submit">[Submit]
<go href="http://yourdomain.com/wap/subscribe1.php" method="post">
<postfield name="fname" value="$(fname)"/>
<postfield name="lname" value="$(lname)"/>
<postfield name="email" value="$(email)"/>
<postfield name="mode" value="1"/>
</go></anchor>
<a href="http://yourdomain.com/wap/">[Home]</a>
<?php elseif ($mode): ?>
<?php
$error = FALSE;
$errtxt = "";
if (empty($fname)) {
$error = True;
echo "First Name is blank<br/>";
}
if (empty($lname)) {
$error = True;
echo "Last Name is blank<br/>";
}
if (empty($email)) {
$error = True;
echo "E-mail is blank<br/>";
} elseif (CheckEmail($email) ) {
$error = True;
echo "Invalid E-mail address<br/>";
}
# If passed edit display thanks and send mail
If (!$error) {
echo "Thanks your subscription has been entered.";
$message .= "First Name : " . $fname . "\n";
$message .= "Last Name : " . $lname . "\n";
$message .= "E-Mail : " . $email . "\n";
$message .= "Entered : " . date("m/d/y h:i") . "\n";
mail("$recipient_name <$recipient_mail>","$subject","$message",
"From: $sender_name <$sender_mail>\nReply-To: $sender_name
<$sender_mail>\nContent-type: text/plain\nX-Mailer: PHP/" . phpversion());
} else {
echo "Press back to correct errors.<br/>";
echo "<do type='prev' label='Back'><prev/></do>";
}
?>
<?php endif; ?>
</small>
</p>
</card>
</wml>
|
|
| WML error handler for the Apache webserver. Categories : PHP, WML, WAP | | | Multi-table database search for your WAP-enabled device. Uses PHP and MySQL. No WMLscript. Categories : WAP, WML, PHP, MySQL | | | wap device's headers on-line on wap phone Categories : WAP, WML, PHP | | | php embeded with wml ,wmlscript ,simple example U can add mysql Categories : WAP, PHP, WML | | | Email a user with out exposing email address Categories : PHP, Databases, MySQL, Email | | | Class for sending mail with MIME attachments in multipart format using external sendmail, mimencode and zip Categories : Email, Network, PHP, PHP Classes | | | Broadcast HTML Email Categories : PHP, Email, MySQL, Databases | | | A web-based php3 IMAP email client supporting address books, attachements (downloading and sending), LDAP searching, and much much more. Categories : Email, PHP, LDAP | | | email new items in db Categories : PHP, Email, Databases, MySQL, Beginner Guides | | | PHP based Contact email form with multiple recipients, text file based, supports departments. Categories : PHP, Email, Beginner Guides, Filesystem | | | email validator check checker email e-mail email address Categories : PHP, Email, Regexps | | | Mail-lib provides a simple interface to the sendmail program. Note: you must actually have sendmail on your machine (sorry windows NT users). Categories : Algorithms, Email, PHP | | | Encoding data using PGP via PHP's proc_* functions Categories : Cryptography, Security, Email, PHP, PGP | | | PHPRecommend v1.0 - "Recommend this page to a friend" script written in
PHP. Easy to install Categories : PHP, URLs, Complete Programs, Email, Site Planning | | | making links from text Categories : PHP, Regexps, Email | |
|
|
|