diff options
-rw-r--r-- | system/helpers/email_helper.php | 54 | ||||
-rw-r--r-- | user_guide/helpers/download_helper.html | 3 | ||||
-rw-r--r-- | user_guide/helpers/email_helper.html | 103 | ||||
-rw-r--r-- | user_guide/helpers/file_helper.html | 5 | ||||
-rw-r--r-- | user_guide/nav/nav.js | 1 | ||||
-rw-r--r-- | user_guide/toc.html | 1 |
6 files changed, 162 insertions, 5 deletions
diff --git a/system/helpers/email_helper.php b/system/helpers/email_helper.php new file mode 100644 index 000000000..3729e042f --- /dev/null +++ b/system/helpers/email_helper.php @@ -0,0 +1,54 @@ +<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * CodeIgniter
+ *
+ * An open source application development framework for PHP 4.3.2 or newer
+ *
+ * @package CodeIgniter
+ * @author ExpressionEngine Dev Team
+ * @copyright Copyright (c) 2006, EllisLab, Inc.
+ * @license http://www.codeigniter.com/user_guide/license.html
+ * @link http://www.codeigniter.com
+ * @since Version 1.0
+ * @filesource
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * CodeIgniter Email Helpers
+ *
+ * @package CodeIgniter
+ * @subpackage Helpers
+ * @category Helpers
+ * @author ExpressionEngine Dev Team
+ * @link http://www.codeigniter.com/user_guide/helpers/email_helper.html
+ */
+
+// ------------------------------------------------------------------------
+
+/**
+ * Validate email address
+ *
+ * @access public
+ * @return bool
+ */
+function valid_email($address)
+{
+ return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;
+}
+
+// ------------------------------------------------------------------------
+
+/**
+ * Send an email
+ *
+ * @access public
+ * @return bool
+ */
+function send_email($recipient, $subject = 'Test email', $message = 'Hello World')
+{
+ return mail($recipient, $subject, $message);
+}
+
+?>
\ No newline at end of file diff --git a/user_guide/helpers/download_helper.html b/user_guide/helpers/download_helper.html index ff9bd2e8d..a82d1980f 100644 --- a/user_guide/helpers/download_helper.html +++ b/user_guide/helpers/download_helper.html @@ -104,8 +104,7 @@ Previous Topic: <a href="directory_helper.html">Directory Helper</a> ·
<a href="#top">Top of Page</a> ·
<a href="../index.html">User Guide Home</a> ·
-Next Topic: <a href="file_helper.html">File Helper</a>
-</p>
+Next Topic: <a href="email_helper.html">Email Helper</a></p>
<p><a href="http://www.codeigniter.com">CodeIgniter</a> · Copyright © 2007 · <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
</div>
diff --git a/user_guide/helpers/email_helper.html b/user_guide/helpers/email_helper.html new file mode 100644 index 000000000..fe0e3cc4a --- /dev/null +++ b/user_guide/helpers/email_helper.html @@ -0,0 +1,103 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+
+<title>CodeIgniter User Guide : Download Helper</title>
+
+<style type='text/css' media='all'>@import url('../userguide.css');</style>
+<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
+
+<script type="text/javascript" src="../nav/nav.js"></script>
+<script type="text/javascript" src="../nav/prototype.lite.js"></script>
+<script type="text/javascript" src="../nav/moo.fx.js"></script>
+<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv='expires' content='-1' />
+<meta http-equiv= 'pragma' content='no-cache' />
+<meta name='robots' content='all' />
+<meta name='author' content='ExpressionEngine Dev Team' />
+<meta name='description' content='CodeIgniter User Guide' />
+
+</head>
+<body>
+
+<!-- START NAVIGATION -->
+<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
+<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
+<div id="masthead">
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
+<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
+</tr>
+</table>
+</div>
+<!-- END NAVIGATION -->
+
+
+<!-- START BREADCRUMB -->
+
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td id="breadcrumb">
+<a href="http://www.codeigniter.com/">CodeIgniter Home</a> ›
+<a href="../index.html">User Guide Home</a> ›
+Download Helper
+</td>
+<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" /> <input type="submit" class="submit" name="sa" value="Go" /></form></td>
+</tr>
+</table>
+<!-- END BREADCRUMB -->
+
+<br clear="all" />
+
+
+<!-- START CONTENT -->
+<div id="content">
+
+
+<h1>Download Helper</h1>
+
+<p>The Download Helper lets you download data to your desktop.</p>
+
+
+<h2>Loading this Helper</h2>
+
+<p>This helper is loaded using the following code:</p>
+<code>$this->load->helper(email);</code>
+
+<p>The following functions are available:</p>
+
+<h2>valid_email('<var>email</var>')</h2>
+
+<p>Checks if an email is a correctly formatted email. Note that is doesn't actually prove the email will recieve mail, simply that it is a validly formed address.</p>
+<p>It returns TRUE/FALSE</p>
+<code> $this->load->helper(email);<br />
+<br />
+if (valid_email('email@somesite.com'))<br />
+{<br />
+ echo 'email is valid';<br />
+}<br />
+else<br />
+{<br />
+ echo 'email is not valid';<br />
+}</code>
+<h2>send_email('<var>recipient</var>', '<var>subject</var>', '<var>message</var>')</h2>
+<p>Sends an email using PHP's native <a href="http://www.php.net/function.mail">mail()</a> function. For a more robust email solution, see CodeIgniter's <a href="../libraries/email.html">Email Class</a>.</p>
+</div>
+<!-- END CONTENT -->
+
+
+<div id="footer">
+<p>
+Previous Topic: <a href="download_helper.html">Download Helper</a>
+ ·
+<a href="#top">Top of Page</a> ·
+<a href="../index.html">User Guide Home</a> ·
+Next Topic: <a href="file_helper.html">File Helper</a></p>
+<p><a href="http://www.codeigniter.com">CodeIgniter</a> · Copyright © 2007 · <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html index 29a859409..d2d61ad09 100644 --- a/user_guide/helpers/file_helper.html +++ b/user_guide/helpers/file_helper.html @@ -136,12 +136,11 @@ can optionally be added to the file names by setting the second parameter to TRU <div id="footer">
<p>
-Previous Topic: <a href="directory_helper.html">Directory Helper</a>
+Previous Topic: <a href="email_helper.html">Email Helper</a>
·
<a href="#top">Top of Page</a> ·
<a href="../index.html">User Guide Home</a> ·
-Next Topic: <a href="form_helper.html">Form Helper</a>
-</p>
+Next Topic: <a href="form_helper.html">Form Helper</a></p>
<p><a href="http://www.codeigniter.com">CodeIgniter</a> · Copyright © 2007 · <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
</div>
diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js index ef484f6f1..951c1905c 100644 --- a/user_guide/nav/nav.js +++ b/user_guide/nav/nav.js @@ -102,6 +102,7 @@ function create_menu(basepath) '<li><a href="'+base+'helpers/date_helper.html">Date Helper</a></li>' +
'<li><a href="'+base+'helpers/directory_helper.html">Directory Helper</a></li>' +
'<li><a href="'+base+'helpers/download_helper.html">Download Helper</a></li>' +
+ '<li><a href="'+base+'helpers/email_helper.html">Email Helper</a></li>' +
'<li><a href="'+base+'helpers/file_helper.html">File Helper</a></li>' +
'<li><a href="'+base+'helpers/form_helper.html">Form Helper</a></li>' +
'<li><a href="'+base+'helpers/html_helper.html">HTML Helper</a></li>' +
diff --git a/user_guide/toc.html b/user_guide/toc.html index 3c6b827cd..465d8f4bd 100644 --- a/user_guide/toc.html +++ b/user_guide/toc.html @@ -158,6 +158,7 @@ Table of Contents <li><a href="./helpers/date_helper.html">Date Helper</a></li>
<li><a href="./helpers/directory_helper.html">Directory Helper</a></li>
<li><a href="./helpers/download_helper.html">Download Helper</a></li>
+<li><a href="./helpers/email_helper.html">Email Helper</a></li>
<li><a href="./helpers/file_helper.html">File Helper</a></li>
<li><a href="./helpers/form_helper.html">Form Helper</a></li>
<li><a href="./helpers/html_helper.html">HTML Helper</a></li>
|