WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Sample WML Mailer
Categories : PHP, WAP, WML, Email Click here to Update Your Picture
Marcus Xenakis
Date : Oct 14th 2000
Grade : 3 of 5 (graded 5 times)
Viewed : 14372
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Marcus Xenakis
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?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