<?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 Protect your mailto: email addresses from bots Categories : PHP , Email , Java Script Class for sending mail with MIME attachments in multipart format using external sendmail, mimencode and zip Categories : Email , Network , PHP , PHP Classes Validator - A PHP class that can can be used for validating Email IDs and Dates Categories : PHP , PHP Classes , Data Validation , Email , Date Time email new items in db Categories : PHP , Email , Databases , MySQL , Beginner Guides PHPRecommend v1.0 - Recommend this page to a friend script written in PHP. Easy to install Categories : PHP , URLs , Complete Programs , Email , Site Planning imap_sort Categories : IMAP , Email , PHP , PHP Functions Three Cool Classes and One Trick Categories : PHP , PHP Classes , Graphics , Email Email a user with out exposing email address Categories : PHP , Databases , MySQL , Email Email attachment code Categories : PHP , Email , Filesystem Simple phone list search for your WAP device. Uses PHP and MySQL. Also lets you dial out to your entries using wtai://wp/mc if your phone supports it. No WMLscript. Categories : PHP , MySQL , WAP PHP port of Matt Wrights FormMail.pl WWW form to e-mail gateway. Categories : Email , Complete Programs , Environment Variables , PHP