<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Learning jQuery &#187; PHP</title>
	<atom:link href="http://www.learningjquery.org/index.php/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learningjquery.org</link>
	<description>Learning jQuery: Tips, techniques, and tutorials for the jQuery JavaScript library</description>
	<lastBuildDate>Tue, 24 Aug 2010 10:10:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>phpmailer发送邮件</title>
		<link>http://www.learningjquery.org/index.php/phpmailer-to-send-mail/</link>
		<comments>http://www.learningjquery.org/index.php/phpmailer-to-send-mail/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 10:04:09 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpmailer]]></category>
		<category><![CDATA[发送邮件]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=222</guid>
		<description><![CDATA[PHPMailer是一个免费，开源且功能强大的php发送邮件类,可以设定发送邮件地址、回复地址、邮件主题、富文本内容,上传附件等。
下载地址：http://sourceforge.net/project/showfiles.php?group_id=26031&#038;package_id=252700
下面我们用一个实例来介绍它的用法。
测试环境：
Ubuntu 9.10
Postfix 2.6.5
PHP 5.2.10

&#60;?php
require_once(&#34;class.phpmailer.php&#34;);

$mail = new PHPMailer();

// 默认编码为 iso-8859-1，当邮件中包含中文字符时，会出现乱码，所以我们改成UTF8
$mail-&#62;CharSet = 'UTF8'; 

// 设置PHPMailer是否使用 SMTP，如果设置了该项，其他相关项也需要设置
$mail-&#62;IsSMTP();

// SMTP服务器地址，也可以使用第三方提供的免费SMTP服务器，如新浪免费邮箱发信(smtp)服务器的地址为：smtp.sina.com
$mail-&#62;Host = 'localhost';

// 设置是否启用SMTP认证，当为true时有时会出错，所以这里我们设置为false
$mail-&#62;SMTPAuth = false;

// SMTP用户名，如果使用linux下的sendmail或postfix等邮件服务器, 此处留空；如果使用第三方的SMTP服务器，要填写相应用户名，也就是你的邮箱地址
$mail-&#62;Username = '';

// SMTP密码，基本同上
$mail-&#62;Password = ''; 

// 设置邮件正文的格式，默认为Html格式，当为false时，使用文本格式
$mail-&#62;IsHTML(true);

// 邮件正文
$mail-&#62;Body = 'The Mail Contents';

// 当用户查看邮件的设备不支持HTML时，可以在这里输入纯文本的内容
$mail-&#62;AltBody = &#34;This is the body in plain text for non-HTML mail clients&#34;; 

// 发件人地址
$mail-&#62;From = 'example@example.com'; 

// 发件人姓名
$mail-&#62;FromName = 'Ben';

// [...]]]></description>
			<content:encoded><![CDATA[<p>PHPMailer是一个免费，开源且功能强大的php发送邮件类,可以设定发送邮件地址、回复地址、邮件主题、富文本内容,上传附件等。</p>
<p>下载地址：http://sourceforge.net/project/showfiles.php?group_id=26031&#038;package_id=252700</p>
<p>下面我们用一个实例来介绍它的用法。</p>
<p>测试环境：<br />
Ubuntu 9.10<br />
Postfix 2.6.5<br />
PHP 5.2.10</p>
<pre class="brush: php;">
&lt;?php
require_once(&quot;class.phpmailer.php&quot;);

$mail = new PHPMailer();

// 默认编码为 iso-8859-1，当邮件中包含中文字符时，会出现乱码，所以我们改成UTF8
$mail-&gt;CharSet = 'UTF8'; 

// 设置PHPMailer是否使用 SMTP，如果设置了该项，其他相关项也需要设置
$mail-&gt;IsSMTP();

// SMTP服务器地址，也可以使用第三方提供的免费SMTP服务器，如新浪免费邮箱发信(smtp)服务器的地址为：smtp.sina.com
$mail-&gt;Host = 'localhost';

// 设置是否启用SMTP认证，当为true时有时会出错，所以这里我们设置为false
$mail-&gt;SMTPAuth = false;

// SMTP用户名，如果使用linux下的sendmail或postfix等邮件服务器, 此处留空；如果使用第三方的SMTP服务器，要填写相应用户名，也就是你的邮箱地址
$mail-&gt;Username = '';

// SMTP密码，基本同上
$mail-&gt;Password = ''; 

// 设置邮件正文的格式，默认为Html格式，当为false时，使用文本格式
$mail-&gt;IsHTML(true);

// 邮件正文
$mail-&gt;Body = 'The Mail Contents';

// 当用户查看邮件的设备不支持HTML时，可以在这里输入纯文本的内容
$mail-&gt;AltBody = &quot;This is the body in plain text for non-HTML mail clients&quot;; 

// 发件人地址
$mail-&gt;From = 'example@example.com'; 

// 发件人姓名
$mail-&gt;FromName = 'Ben';

// 也可以这样设置发件人的址址及姓名

$mail-&gt;SetFrom('example@example.com', 'Ben');

// 添加回复地址，姓名
$mail-&gt;AddReplyTo(&quot;example@example.com&quot;,&quot;Reply Name&quot;);

// 添加抄送地址，貌似只能在win32平台使用，未做测试
$mail-&gt;AddCC($address, $name = &quot;&quot;);

// 添加密送地址，貌似只能在win32平台使用，未做测试
$msil-&gt;AddBCC($address, $name = &quot;&quot;);

$mail-&gt;Subject = 'Test'; // 邮件主题

// AddAddress($address, $name = &quot;&quot;), 添加一个收件人地址，收件人姓名默认为空
$mail-&gt;AddAddress('example@example.com');

// 添加一个附件
$mail-&gt;AddAttachment(&quot;doc/learningjquery.pdf&quot;);

// 清除所有收件人地址,当给多人发送邮件时，此方法尤其有用
$mail-&gt;ClearAddresses();

// Send()方法：创建信息和发送邮件,如果发送失败返回false,使用下面的ErrorInfo属性可以显示错误描述,发送成功返回true
if(!$mail-&gt;Send())
{
	echo &quot;Mailer Error: &quot; . $mail-&gt;ErrorInfo;
	exit;
}

echo 'Send Successful.';
?&gt;
</pre>
<p>PHPMailer的方法请参见： http://phpmailer.worxware.com/index.php?pg=methods<br />
PHPMailer的属性请参见： http://phpmailer.worxware.com/index.php?pg=properties</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/phpmailer-to-send-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rmail for php 使用Rmail 发送邮件</title>
		<link>http://www.learningjquery.org/index.php/rmail-for-php-to-send-mail-using-rmail/</link>
		<comments>http://www.learningjquery.org/index.php/rmail-for-php-to-send-mail-using-rmail/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 08:01:38 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[Rmail]]></category>
		<category><![CDATA[发送邮件]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=220</guid>
		<description><![CDATA[
&#60;?php
require_once('Rmail.php');

$mail = new Rmail();

/**
 * 设置邮件是来自何处
 */
$mail-&#62;setFrom('Richard &#60;richard@example.com&#62;');

/**
 * 设置文本的编码
 */
$mail-&#62;setTextCharset('UTF-8');

/**
 * 设置HTML的编码,如果HTML中存在中文，可将编码设置成'UTF-8',否则会出现乱码
 */
$mail-&#62;setHTMLCharset('UTF-8');

/**
 * 设置抄送地址
 */
$mail-&#62;setCc('Bob &#60;bob@example.com&#62;');

/**
 * 设置密送地址
 */
$mail-&#62;setBcc('Fred &#60;fred@example.com&#62;');

/**
 * 设置邮件的主题(标题)
 */
$mail-&#62;setSubject('Test email');

/**
 * 设置邮件的优先级，可用参数有：high、normal、low、1、3、5
 */
$mail-&#62;setPriority('high');

/**
 * 设置邮件发送的文本
 */
$mail-&#62;setText('Sample text');

/**
 * 当然也可以将HTML代码做为邮件内容，HTML中的图片会被自动发现。
 */
$mail-&#62;setHTML('&#60;b&#62;Sample HTML&#60;/b&#62; &#60;img src=&#34;background.gif&#34;&#62;');

/**
 * 设置回复邮件时用的邮件地址，参数是一个合法的电子邮件地址。
 */
$mail-&#62;setReceipt('test@test.com');

/**
 * Add an embedded image. The path is the file path to the [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: php;">
&lt;?php
require_once('Rmail.php');

$mail = new Rmail();

/**
 * 设置邮件是来自何处
 */
$mail-&gt;setFrom('Richard &lt;richard@example.com&gt;');

/**
 * 设置文本的编码
 */
$mail-&gt;setTextCharset('UTF-8');

/**
 * 设置HTML的编码,如果HTML中存在中文，可将编码设置成'UTF-8',否则会出现乱码
 */
$mail-&gt;setHTMLCharset('UTF-8');

/**
 * 设置抄送地址
 */
$mail-&gt;setCc('Bob &lt;bob@example.com&gt;');

/**
 * 设置密送地址
 */
$mail-&gt;setBcc('Fred &lt;fred@example.com&gt;');

/**
 * 设置邮件的主题(标题)
 */
$mail-&gt;setSubject('Test email');

/**
 * 设置邮件的优先级，可用参数有：high、normal、low、1、3、5
 */
$mail-&gt;setPriority('high');

/**
 * 设置邮件发送的文本
 */
$mail-&gt;setText('Sample text');

/**
 * 当然也可以将HTML代码做为邮件内容，HTML中的图片会被自动发现。
 */
$mail-&gt;setHTML('&lt;b&gt;Sample HTML&lt;/b&gt; &lt;img src=&quot;background.gif&quot;&gt;');

/**
 * 设置回复邮件时用的邮件地址，参数是一个合法的电子邮件地址。
 */
$mail-&gt;setReceipt('test@test.com');

/**
 * Add an embedded image. The path is the file path to the image.
 * 添加一个嵌入的图像，该路径是图片文件的路径。
 */
$mail-&gt;addEmbeddedImage(new fileEmbeddedImage('background.gif'));

/**
 * 添加邮件附件
 */
$mail-&gt;addAttachment(new fileAttachment('example.zip'));

/**
 * 发送邮件，参数为收件人电子邮件地址组成的数组。
 */
$address = array('ben@learningjquery.org');
$result  = $mail-&gt;send($address);

// 相关方法
/*
    *  constructor
    * setCRLF()
    * setSMTPParams()
    * setSendmailPath()
    * setTextEncoding()
    * setHTMLEncoding()
    * setTextCharset()
    * setHTMLCharset()
    * setHeadCharset()
    * setTextWrap()
    * setHeader()
    * setReceipt()
    * setSubject()
    * setFrom()
    * setPriority()
    * setReturnPath()
    * setCc()
    * setBcc()
    * setText()
    * setHTML()
    * addAttachment()
    * send()
    * getRFC822()
*/
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/rmail-for-php-to-send-mail-using-rmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use PHP Functions In JavaScript: PHP.JS</title>
		<link>http://www.learningjquery.org/index.php/use-php-functions-in-javascript-phpjs/</link>
		<comments>http://www.learningjquery.org/index.php/use-php-functions-in-javascript-phpjs/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 01:19:43 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=72</guid>
		<description><![CDATA[PHP.JS is a JavaScript library that enables anyone to use PHP functions client-side.
It can be very helpful to any developer who wants to get the PHP functions on static pages, get the extra functionality (like being able to use file_get_contents(), mktime(), serialize() ) &#38; take the load off the server.

Currently ~400 functions are ported &#38; there [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://phpjs.org/" target="_blank"><strong>PHP.JS</strong></a> is a <strong>JavaScript library</strong> that enables anyone to <strong>use PHP functions client-side</strong>.</p>
<p>It can be very helpful to any developer who wants to get the PHP functions on static pages, get the extra functionality (like being able to use <code>file_get_contents()</code>, <code>mktime()</code>, <code>serialize()</code> ) &amp; take the load off the server.</p>
<p><a href="http://phpjs.org/" target="_blank"><img src="http://www.webresourcesdepot.com/wp-content/uploads/image/php-js.jpg" alt="PHP.JS" width="480" height="70" /></a></p>
<p>Currently ~400 functions are ported &amp; there are still ones being experimented or waiting to be included. But it is possible to find the most popular ones (even <code>md5()</code>).</p>
<p>The download packages can be totally customized &amp; it is possible to get only the functions you need besides all of them.</p>
<p><strong>Requirements:</strong> No Requirements<br />
<strong>Compatibility:</strong> All Major Browsers<br />
<strong>Website:</strong> <a href="http://phpjs.org/" target="_blank">http://phpjs.org/</a><br />
<strong>Download:</strong> <a href="http://phpjs.org/packages/index" target="_blank">http://phpjs.org/packages/index</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/use-php-functions-in-javascript-phpjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy Development With CodeIgniter</title>
		<link>http://www.learningjquery.org/index.php/easy-development-with-codeigniter/</link>
		<comments>http://www.learningjquery.org/index.php/easy-development-with-codeigniter/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 03:01:48 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CodeIgniter]]></category>

		<guid isPermaLink="false">http://www.learningjquery.org/?p=28</guid>
		<description><![CDATA[作者：Jeffrey Way
In this week’s 30 minute screencast, I’m going to show you how easy it is to work with the MVC pattern and CodeIgniter. This video is aimed at beginners who have no experience with a PHP framework.
For demonstration purposes, we’ll be building a simple image upload utility. We’ll then perform some validation, save the [...]]]></description>
			<content:encoded><![CDATA[<p>作者：<span class="entry-author-name">Jeffrey Way</span></p>
<p>In this week’s <strong>30 minute screencast</strong>, I’m going to show you how easy it is to work with the MVC pattern and CodeIgniter. This video is aimed at beginners who have no experience with a PHP framework.</p>
<p>For demonstration purposes, we’ll be building a simple image upload utility. We’ll then perform some validation, save the file to our uploads folder, and automatically create a respective thumbnail. With raw PHP, this can be somewhat time-consuming. However, with <a href="http://codeigniter.com/" target="_blank">CodeIgniter</a>, it’s simply a matter of referencing the correct library, and passing in some configuration options! Let’s dive in.</p>
<div><a href="http://nettuts.s3.amazonaws.com/363_ci_image_upload/imageUpload.zip" target="_blank"><img src="http://nettuts.com/wp-content/themes/nettuts/site_images/button_src_nm.jpg" alt="" /></a></div>
<h3>The Tutorial</h3>
<div><embed type="application/x-shockwave-flash" width="590" height="443" src="http://blip.tv/play/gcMVgYyhCAA" allowscriptaccess="never" allowfullscreen="true" wmode="transparent"></embed><span class="link popout" title="点击打开新窗口">弹出</span></div>
<h3>Final Controller</h3>
<pre>&lt;?php

class Upload extends Controller {

	function Upload() {
		parent::Controller();
		// $this-&gt;load-&gt;helper('form');
	}

	function index() {
		$this-&gt;load-&gt;view('upload_form');
	}

	function doUpload() {
		$config['upload_path'] = 'uploads/';
		$config['allowed_types'] = 'gif|jpg|jpeg|png';
		$config['max_size'] = '1000';
		$config['max_width'] = '1920';
		$config['max_height'] = '1280';						

		$this-&gt;load-&gt;library('upload', $config);

		if(!$this-&gt;upload-&gt;do_upload()) echo $this-&gt;upload-&gt;display_errors();
		else {
			$fInfo = $this-&gt;upload-&gt;data();
			$this-&gt;_createThumbnail($fInfo['file_name']);

			$data['uploadInfo'] = $fInfo;
			$data['thumbnail_name'] = $fInfo['raw_name'] . '_thumb' . $fInfo['file_ext'];
			$this-&gt;load-&gt;view('upload_success', $data);
		}
	}

	function _createThumbnail($fileName) {
		$config['image_library'] = 'gd2';
		$config['source_image'] = 'uploads/' . $fileName;
		$config['create_thumb'] = TRUE;
		$config['maintain_ratio'] = TRUE;
		$config['width'] = 75;
		$config['height'] = 75;

		$this-&gt;load-&gt;library('image_lib', $config);
		if(!$this-&gt;image_lib-&gt;resize()) echo $this-&gt;image_lib-&gt;display_errors();
	}
}</pre>
<h3>Final View</h3>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;

&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Upload an Image &lt;/title&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;/head&gt;

  &lt;body&gt;
    &lt;div id="container"&gt;
    	&lt;h2&gt;Upload an Image &lt;/h2&gt;

		&lt;?php echo form_open_multipart('upload/doUpload'); ?&gt;
		&lt;input type="file" name="userfile" /&gt;
		&lt;p&gt;&lt;input type="submit" value="Submit" name="submit" /&gt;&lt;/p&gt;
		&lt;?php echo form_close(); ?&gt;
    &lt;/div&gt;

  &lt;/body&gt;
&lt;/html&gt;</pre>
<p>I hope you guys enjoyed this video tutorial. If you’d like to see more CodeIgniter tutorials and videos on Nettuts+, please be loud in the comments. I know I’d like to see more! I’m in the process of learning this framework myself, so links to resources, tips, etc. will be much appreciated!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learningjquery.org/index.php/easy-development-with-codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
