<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>/smarthosting/content/w/wddmprof/.website4844/bb-settings.php</b> on line <b>186</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>/smarthosting/content/w/wddmprof/.website4844/bb-includes/backpress/functions.wp-object-cache.php</b> on line <b>108</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>/smarthosting/content/w/wddmprof/.website4844/bb-includes/backpress/pomo/mo.php</b> on line <b>171</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>/smarthosting/content/w/wddmprof/.website4844/bb-includes/functions.bb-l10n.php</b> on line <b>484</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>/smarthosting/content/w/wddmprof/.website4844/bb-includes/backpress/class.wp-taxonomy.php</b> on line <b>581</b><br />
<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>WDDM Forum &#187; Recent Topics</title>
		<link>http://forum.wddmportfolios.com/</link>
		<description>WDDM Student Community</description>
		<language>en-US</language>
		<pubDate>Wed, 22 Feb 2012 20:57:12 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forum.wddmportfolios.com/search.php</link>
		</textInput>
		<atom:link href="http://forum.wddmportfolios.com/rss/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>cameron.lillico on "Job Opportunity: Web Developer (Drupal)"</title>
			<link>http://forum.wddmportfolios.com/topic/job-opportunity-web-developer-drupal#post-628</link>
			<pubDate>Wed, 15 Jun 2011 13:09:18 +0000</pubDate>
			<dc:creator>cameron.lillico</dc:creator>
			<guid isPermaLink="false">628@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;I Love Rewards is a web product (Saas) development company in downtown Toronto. We are presently searching for an experienced Web Developer to join our rapidly-growing company. Working within a team the successful candidate will execute all corporate website initiatives which include raw coding, maintenance, and website-CRM system integration.&#60;/p&#62;
&#60;p&#62;Please view the posting here:&#60;br /&#62;
&#60;a href=&#34;http://tbe.taleo.net/NA11/ats/careers/requisition.jsp?org=ILOVEREWARDS&#38;amp;cws=1&#38;amp;rid=126&#34; rel=&#34;nofollow&#34;&#62;http://tbe.taleo.net/NA11/ats/careers/requisition.jsp?org=ILOVEREWARDS&#38;amp;cws=1&#38;amp;rid=126&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;If you're interested or have questions contact me at &#60;a href=&#34;mailto:cameron.lillico@iloverewards.com&#34;&#62;cameron.lillico@iloverewards.com&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>alexandra.irving on "how do you pay a coder?"</title>
			<link>http://forum.wddmportfolios.com/topic/how-do-you-pay-a-coder#post-627</link>
			<pubDate>Mon, 28 Mar 2011 11:50:39 +0000</pubDate>
			<dc:creator>alexandra.irving</dc:creator>
			<guid isPermaLink="false">627@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;just say you were designing a freelance web site and there was some coding stuff you wanted to pay someone else to do. how much do you pay a coder? is it a percentage of the job or a flat rate for certain tasks etc?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>preet.walia on "Upload a large SQL file"</title>
			<link>http://forum.wddmportfolios.com/topic/upload-a-large-sql-file#post-623</link>
			<pubDate>Wed, 12 Jan 2011 15:45:52 +0000</pubDate>
			<dc:creator>preet.walia</dc:creator>
			<guid isPermaLink="false">623@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;How can i upload a large sql file around 600000kb to mysql database.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>kevin.thackorie on "PHP.js &#124; JavaScript Functions Built to Mimic PHP Functions"</title>
			<link>http://forum.wddmportfolios.com/topic/phpjs-javascript-functions-built-to-mimic-php-functions#post-620</link>
			<pubDate>Wed, 15 Dec 2010 10:43:48 +0000</pubDate>
			<dc:creator>kevin.thackorie</dc:creator>
			<guid isPermaLink="false">620@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;This is handy if you've ever been writing JS and cried, &#34;Why doesn't JavaScript have a function like PHP's... !?&#34;&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://phpjs.org/&#34;&#62;PHP.js&#60;/a&#62; website
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mike.sven on "AR Christmas Card"</title>
			<link>http://forum.wddmportfolios.com/topic/ar-christmas-card#post-621</link>
			<pubDate>Fri, 17 Dec 2010 12:38:27 +0000</pubDate>
			<dc:creator>mike.sven</dc:creator>
			<guid isPermaLink="false">621@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Hey Guys,  Something I have been working on recently ... Take a look ... Enjoy!&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://bit.ly/g2CKv5&#34; rel=&#34;nofollow&#34;&#62;http://bit.ly/g2CKv5&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>kevin.thackorie on "Job Opportunity: Expert Drupal 6 PHP Developer"</title>
			<link>http://forum.wddmportfolios.com/topic/job-opportunity-expert-drupal-6-php-developer#post-587</link>
			<pubDate>Tue, 09 Nov 2010 12:19:39 +0000</pubDate>
			<dc:creator>kevin.thackorie</dc:creator>
			<guid isPermaLink="false">587@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;207 Media Inc. is a web product development company in Oakville, Ontario. We are presently searching for an expert Drupal 6 Developer. Please refer to the &#60;a href=&#34;http://www.207media.com/jobs/&#34;&#62;job posting&#60;/a&#62; for further details.&#60;/p&#62;
&#60;p&#62;Qualified candidates may apply directly to the hiring Manager via the e-mail listed on the above posting and/or contact me for additional information at kevin.thackorie[at]207media[dot]com.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mike.clark on "Mike &#38; Nalin&#039;s talk"</title>
			<link>http://forum.wddmportfolios.com/topic/mike-nalins-talk#post-476</link>
			<pubDate>Fri, 07 May 2010 21:25:04 +0000</pubDate>
			<dc:creator>mike.clark</dc:creator>
			<guid isPermaLink="false">476@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Hi all,&#60;/p&#62;
&#60;p&#62;Mike here - below are my notes from today's talk and some links you'll hopefully find useful. I'll try to keep an eye on this thread for the next little while so let me know if you have any questions related to today.&#60;/p&#62;
&#60;p&#62;Take Aways from the Program&#60;br /&#62;
- try a bit of everything, then start to specialize&#60;br /&#62;
- develop a network of peers (learn from and push each other)&#60;br /&#62;
- complete assignments and move on - each project will be better than the last&#60;br /&#62;
- collaborate with those who have complimentary skills&#60;br /&#62;
- think about design as problem-solving - have reasons for your decisions&#60;br /&#62;
- practice with what's coming, what's established&#60;/p&#62;
&#60;p&#62;The Job Hunt&#60;br /&#62;
- willingness and ability to learn more important than what you know (junior positions are all about your potential)&#60;br /&#62;
- a network of peers is almost essential for getting your foot in the *right* door&#60;br /&#62;
- be involved in the community (peers from school, local *Camps, Ignite Events, Refresh Events, FITC, NXNEi, Drupal Users Group, Twitter, Facebook, Dribbble, etc.)&#60;br /&#62;
- tell people you're looking (keep yourself in their heads, use their networks too)&#60;br /&#62;
- I don't recommend relying in freelance to pay the bills - at least not in the first year&#60;/p&#62;
&#60;p&#62;Day in the Life&#60;br /&#62;
- &#34;CMS Web Designer&#34; at UofT - everything from one-page brochure-ware sites to large CMS sites for entire faculties, central university services.&#60;br /&#62;
- design lead for projects: initial meeting, IA, design, theme coding, support&#60;br /&#62;
- other team members dedicated to training, back-end development&#60;br /&#62;
- ~150 clients and growing&#60;br /&#62;
- ~12 projects on the go at any time&#60;br /&#62;
- Proprietary enterprise CMS (.NET), WordPress 3 (PHP), Drupal 7 (PHP)&#60;br /&#62;
- balance the needs of the client business (managing the site, required functionality), their users (IA/design), the budget ($5k-$30k for most websites, $5k-$100k for web apps), the timeline (2 weeks - 2 years)&#60;br /&#62;
- HTML5, CSS3, jQuery, PHP&#60;br /&#62;
- Photoshop, Coda, Firebug/Web Developer Toolkit, VMWare Fusion, IETester&#60;br /&#62;
- Firefox, Safari, Chrome, IE 6/7/8/9&#60;/p&#62;
&#60;p&#62;- Workflow: Creative brief, kick-off meeting, information architecture, pen and paper sketches, wireframes, static mock-ups and/or web prototypes, design meeting, debugging, staging site, client training, content prep, documentation, final tweaks, content freeze, cross fingers, launch&#60;/p&#62;
&#60;p&#62;- Atmosphere: small team (4 people total), time management and independent work a must, teamwork also essential for some tasks, projects. Able to communicate with clients, both to guide them through the IA/content strategy as well as developing and defending designs&#60;/p&#62;
&#60;p&#62;- Enterprise CMS: Big sites (UofT sees 3,000,000 hits/day), many users (Faculty of Medicine = 200 active site users), fine control over user groups, rolls and workflows, fine control over media and other digital assets, professionally documented and supported, consistent user experience across multiple sites, lack agility, awkwardly integrates community features into an unrelated document management, event management or content management model, closed API (difficult to develop custom plugins/modules for, integrate with secure authorization, etc.)&#60;/p&#62;
&#60;p&#62;- Enterprise CMS (Part 2): Solve closed source problems by adopting an enterprise-worthy open source CMS (Drupal). Develop standardized UofT base template and best practices with UofT Drupal Users Group. Develop university-vetted custom modules for secure authentication, etc. For other projects that don't require an enterprise-level solution, WordPress is very agile (quick to set up, design/develop themes for, add content to and launch) and a popular solution.&#60;/p&#62;
&#60;p&#62;- Post-Recession: University environment is largely sheltered from the rest of the job market's difficulty. Many people go back to school during a recession - the university focused on promoting itself (promotion requires online presence, new websites, etc.).&#60;/p&#62;
&#60;p&#62;My (Hopefully) Useful Links&#60;br /&#62;
- &#60;a href=&#34;http://www.alistapart.com/&#34; rel=&#34;nofollow&#34;&#62;http://www.alistapart.com/&#60;/a&#62; &#38;lt;-- great articles&#60;br /&#62;
- &#60;a href=&#34;http://net.tutsplus.com/&#34; rel=&#34;nofollow&#34;&#62;http://net.tutsplus.com/&#60;/a&#62; &#38;lt;-- lots of tutorials, part of a network of sites&#60;br /&#62;
- &#60;a href=&#34;http://dribbble.com/&#34; rel=&#34;nofollow&#34;&#62;http://dribbble.com/&#60;/a&#62; &#38;lt;-- constant stream of design work&#60;br /&#62;
- &#60;a href=&#34;http://52weeksofux.com/&#34; rel=&#34;nofollow&#34;&#62;http://52weeksofux.com/&#60;/a&#62; &#38;lt;-- numerous lessons on user experience design&#60;br /&#62;
- &#60;a href=&#34;http://molecularvoices.molecular.com/standards/&#34; rel=&#34;nofollow&#34;&#62;http://molecularvoices.molecular.com/standards/&#60;/a&#62; &#38;lt;-- best practices guide&#60;br /&#62;
- &#60;a href=&#34;http://www.webmonkey.com/2010/02/information_architecture_tutorial/&#34; rel=&#34;nofollow&#34;&#62;http://www.webmonkey.com/2010/02/information_architecture_tutorial/&#60;/a&#62; &#38;lt;-- IA tutorial&#60;br /&#62;
- &#60;a href=&#34;http://dl.dropbox.com/u/1982509/creative%20brief.docx&#34; rel=&#34;nofollow&#34;&#62;http://dl.dropbox.com/u/1982509/creative%20brief.docx&#60;/a&#62; &#38;lt;-- my creative brief&#60;br /&#62;
- &#60;a href=&#34;http://wordpress.tv/category/how-to/&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.tv/category/how-to/&#60;/a&#62; &#38;lt;-- WordPress video tutorials&#60;/p&#62;
&#60;p&#62;- Designing With Web Standards, 3rd Edition &#38;lt;-- If you only buy one book, consider this one&#60;/p&#62;
&#60;p&#62;Interview questions: &#60;a href=&#34;http://docs.google.com/present/view?id=dcxrv3q7_41dr5dktc4&#34; rel=&#34;nofollow&#34;&#62;http://docs.google.com/present/view?id=dcxrv3q7_41dr5dktc4&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>francis.san.juan on "Need a Regular Expression for a Username Check"</title>
			<link>http://forum.wddmportfolios.com/topic/need-a-regular-expression-for-a-username-check#post-615</link>
			<pubDate>Fri, 03 Dec 2010 11:57:47 +0000</pubDate>
			<dc:creator>francis.san.juan</dc:creator>
			<guid isPermaLink="false">615@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;I'm creating form validation for a site registration form and I want to check that a person's username has the following conditions:&#60;/p&#62;
&#60;p&#62;- Must start with a letter (lower or uppercase, doesn't matter)&#60;br /&#62;
- The rest of the username can contain upper/lowercase letters, or numbers, or underscores&#60;br /&#62;
- Contains no quotes or special characters (except underscores)&#60;/p&#62;
&#60;p&#62;So far I'm using this code to check if username doesn't match the appropriate pattern required:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if ( preg_match(&#34;/^[a-zA-Z]\w/i&#34;, $username) == 0 )&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I just wanted to verify that this regular expression and php code is correct.&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>wen.ni on "MakePassword"</title>
			<link>http://forum.wddmportfolios.com/topic/makepassword#post-614</link>
			<pubDate>Wed, 10 Nov 2010 13:10:28 +0000</pubDate>
			<dc:creator>wen.ni</dc:creator>
			<guid isPermaLink="false">614@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Create a random password. &#60;/p&#62;
&#60;p&#62;function MakePassword($length)&#60;br /&#62;
{&#60;br /&#62;
    $pass = &#34;&#34;;&#60;br /&#62;
    $chars = array(&#60;br /&#62;
    &#34;1&#34;,&#34;2&#34;,&#34;3&#34;,&#34;4&#34;,&#34;5&#34;,&#34;6&#34;,&#34;7&#34;,&#34;8&#34;,&#34;9&#34;,&#34;0&#34;,&#60;br /&#62;
    &#34;a&#34;,&#34;A&#34;,&#34;b&#34;,&#34;B&#34;,&#34;c&#34;,&#34;C&#34;,&#34;d&#34;,&#34;D&#34;,&#34;e&#34;,&#34;E&#34;,&#34;f&#34;,&#34;F&#34;,&#34;g&#34;,&#34;G&#34;,&#34;h&#34;,&#34;H&#34;,&#34;i&#34;,&#34;I&#34;,&#34;j&#34;,&#34;J&#34;,&#60;br /&#62;
    &#34;k&#34;,&#34;K&#34;,&#34;l&#34;,&#34;L&#34;,&#34;m&#34;,&#34;M&#34;,&#34;n&#34;,&#34;N&#34;,&#34;o&#34;,&#34;O&#34;,&#34;p&#34;,&#34;P&#34;,&#34;q&#34;,&#34;Q&#34;,&#34;r&#34;,&#34;R&#34;,&#34;s&#34;,&#34;S&#34;,&#34;t&#34;,&#34;T&#34;,&#60;br /&#62;
    &#34;u&#34;,&#34;U&#34;,&#34;v&#34;,&#34;V&#34;,&#34;w&#34;,&#34;W&#34;,&#34;x&#34;,&#34;X&#34;,&#34;y&#34;,&#34;Y&#34;,&#34;z&#34;,&#34;Z&#34;);&#60;/p&#62;
&#60;p&#62;    $count = count($chars) - 1;&#60;/p&#62;
&#60;p&#62;    srand((double)microtime()*1000000);&#60;/p&#62;
&#60;p&#62;    for($i = 0; $i &#38;lt; $length; $i++)&#60;br /&#62;
    {&#60;br /&#62;
    $pass .= $chars[rand(0, $count)];&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    return($pass);&#60;br /&#62;
}
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mark.watson on "Get Remote IP Address in PHP"</title>
			<link>http://forum.wddmportfolios.com/topic/get-remote-ip-address-in-php#post-613</link>
			<pubDate>Wed, 10 Nov 2010 12:04:29 +0000</pubDate>
			<dc:creator>mark.watson</dc:creator>
			<guid isPermaLink="false">613@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;The above code will not work in case your client is behind proxy server. In that case use below function to get real IP address of client.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;/p&#62;
&#60;p&#62;function getRemoteIPAddress() {&#60;br /&#62;
	    $ip = $_SERVER['REMOTE_ADDR'];&#60;br /&#62;
	    return $ip;&#60;br /&#62;
	}&#60;br /&#62;
-----------------------------------------------------------&#60;br /&#62;
bottom code&#60;/p&#62;
&#60;p&#62;function getRealIPAddr()&#60;br /&#62;
02	{&#60;br /&#62;
03	    if (!empty($_SERVER['HTTP_CLIENT_IP']))   //check ip from share internet&#60;br /&#62;
04	    {&#60;br /&#62;
05	        $ip=$_SERVER['HTTP_CLIENT_IP'];&#60;br /&#62;
06	    }&#60;br /&#62;
07	    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))   //to check ip is pass from proxy&#60;br /&#62;
	    {&#60;br /&#62;
	        $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];&#60;br /&#62;
	    }&#60;br /&#62;
	    else&#60;br /&#62;
	    {&#60;br /&#62;
	        $ip=$_SERVER['REMOTE_ADDR'];&#60;br /&#62;
	    }&#60;br /&#62;
	    return $ip;&#60;br /&#62;
	}&#60;/p&#62;
&#60;p&#62;&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>cameron.lillico on "Compress Multiple CSS Files for Faster Loading"</title>
			<link>http://forum.wddmportfolios.com/topic/compress-multiple-css-files-for-faster-loading#post-612</link>
			<pubDate>Wed, 10 Nov 2010 11:59:20 +0000</pubDate>
			<dc:creator>cameron.lillico</dc:creator>
			<guid isPermaLink="false">612@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;I had never thought about needing this before, but if/when we get into more complex websites, this apparently saves precious bandwidth and in turn, loading time. Especially since we take so much effort to optimize our images, etc. as well. &#60;/p&#62;
&#60;p&#62;What this does is compresses all your linked css files by flattening all the white spaces and anything else not needed that is stored as memory. &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;01.header(&#38;#39;Content-type: text/css&#38;#39;);
02.ob_start(&#38;quot;compress&#38;quot;);
03.function compress($buffer) {
04.  /* remove comments */
05.  $buffer = preg_replace(&#38;#39;!/\*[^*]*\*+([^/][^*]*\*+)*/!&#38;#39;, &#38;#39;&#38;#39;, $buffer);
06.  /* remove tabs, spaces, newlines, etc. */
07.  $buffer = str_replace(array(&#38;quot;\r\n&#38;quot;, &#38;quot;\r&#38;quot;, &#38;quot;\n&#38;quot;, &#38;quot;\t&#38;quot;, &#38;#39;  &#38;#39;, &#38;#39;    &#38;#39;, &#38;#39;    &#38;#39;), &#38;#39;&#38;#39;, $buffer);
08.  return $buffer;
09.}
10.
11./* your css files */
12.include(&#38;#39;master.css&#38;#39;);
13.include(&#38;#39;typography.css&#38;#39;);
14.include(&#38;#39;grid.css&#38;#39;);
15.include(&#38;#39;print.css&#38;#39;);
16.include(&#38;#39;handheld.css&#38;#39;);
17.
18.ob_end_flush();&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Follow this link to check out other ways to do this, as well as more info on the one above.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.phpsnippets.info/compress-css-files-using-php&#34; rel=&#34;nofollow&#34;&#62;http://www.phpsnippets.info/compress-css-files-using-php&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>alexander.nikolov on "Human Readable String - Captchas"</title>
			<link>http://forum.wddmportfolios.com/topic/human-readable-string-captchas#post-611</link>
			<pubDate>Wed, 10 Nov 2010 11:33:28 +0000</pubDate>
			<dc:creator>alexander.nikolov</dc:creator>
			<guid isPermaLink="false">611@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;This script allows you to create what is known as a &#34;Captcha.&#34; A captcha is a randomly generated &#34;test&#34; to ensure that the response is not generated by a computer. Ever been to a site (i.e. an online apparel shop) where you are asked to re-type a group of characters for validation purposes? This is a captcha.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;/**************
*@length - length of random string (must be a multiple of 2)
**************/
function readable_random_string($length = 6){
    $conso=array(&#38;quot;b&#38;quot;,&#38;quot;c&#38;quot;,&#38;quot;d&#38;quot;,&#38;quot;f&#38;quot;,&#38;quot;g&#38;quot;,&#38;quot;h&#38;quot;,&#38;quot;j&#38;quot;,&#38;quot;k&#38;quot;,&#38;quot;l&#38;quot;,
    &#38;quot;m&#38;quot;,&#38;quot;n&#38;quot;,&#38;quot;p&#38;quot;,&#38;quot;r&#38;quot;,&#38;quot;s&#38;quot;,&#38;quot;t&#38;quot;,&#38;quot;v&#38;quot;,&#38;quot;w&#38;quot;,&#38;quot;x&#38;quot;,&#38;quot;y&#38;quot;,&#38;quot;z&#38;quot;);
    $vocal=array(&#38;quot;a&#38;quot;,&#38;quot;e&#38;quot;,&#38;quot;i&#38;quot;,&#38;quot;o&#38;quot;,&#38;quot;u&#38;quot;);
    $password=&#38;quot;&#38;quot;;
    srand ((double)microtime()*1000000);
    $max = $length/2;
    for($i=1; $i&#38;lt;=$max; $i++)
    {
    $password.=$conso[rand(0,19)];
    $password.=$vocal[rand(0,4)];
    }
    return $password;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>amanda.higgins on "Converts a string into individual gif images"</title>
			<link>http://forum.wddmportfolios.com/topic/converts-a-string-into-individual-gif-images#post-610</link>
			<pubDate>Wed, 10 Nov 2010 10:53:51 +0000</pubDate>
			<dc:creator>amanda.higgins</dc:creator>
			<guid isPermaLink="false">610@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;function numbertoimage($numb,$skin)&#60;br /&#62;
{&#60;br /&#62;
    $arr = str_split($numb);&#60;br /&#62;
    $cnt = count($arr);&#60;br /&#62;
    $image = &#34;&#34;;&#60;br /&#62;
    for ($b=0;$b&#38;lt;$cnt;$b++)&#60;br /&#62;
        switch ($skin)&#60;br /&#62;
        {&#60;br /&#62;
            case 0: $image .= &#34;&#38;lt;img src='files/bw{$arr[$b]}.gif'&#38;gt;&#34;; break;&#60;br /&#62;
            case 1: $image .= &#34;&#38;lt;img src='files/o{$arr[$b]}.gif'&#38;gt;&#34;; break;&#60;br /&#62;
            case 2: $image .= &#34;&#38;lt;img src='files/sm{$arr[$b]}.gif'&#38;gt;&#34;; break;&#60;br /&#62;
        }&#60;br /&#62;
    return $image;&#60;br /&#62;
}
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanie.hucko on "Add (th, st, nd, rd, th) to the end of a number"</title>
			<link>http://forum.wddmportfolios.com/topic/add-th-st-nd-rd-th-to-the-end-of-a-number#post-609</link>
			<pubDate>Wed, 10 Nov 2010 10:32:23 +0000</pubDate>
			<dc:creator>stephanie.hucko</dc:creator>
			<guid isPermaLink="false">609@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Also just found this!&#60;br /&#62;
This simple and easy function will take a number and add &#34;th, st, nd, rd, th&#34; after it. Example&#60;br /&#62;
10 to 10th&#60;br /&#62;
1 to 1st.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
function ordinal($cdnl){
    $test_c = abs($cdnl) % 10;
    $ext = ((abs($cdnl) %100 &#38;lt; 21 &#38;amp;&#38;amp; abs($cdnl) %100 &#38;gt; 4) ? &#38;#39;th&#38;#39;
            : (($test_c &#38;lt; 4) ? ($test_c &#38;lt; 3) ? ($test_c &#38;lt; 2) ? ($test_c &#38;lt; 1)
            ? &#38;#39;th&#38;#39; : &#38;#39;st&#38;#39; : &#38;#39;nd&#38;#39; : &#38;#39;rd&#38;#39; : &#38;#39;th&#38;#39;));
    return $cdnl.$ext;
}
for($i=1;$i&#38;lt;100;$i++){
    echo ordinal($i).&#38;#39;&#38;lt;br&#38;gt;&#38;#39;;
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>christine.schaefer on "Variable  when to use?"</title>
			<link>http://forum.wddmportfolios.com/topic/variable-when-to-use#post-608</link>
			<pubDate>Wed, 10 Nov 2010 10:31:33 +0000</pubDate>
			<dc:creator>christine.schaefer</dc:creator>
			<guid isPermaLink="false">608@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Variables are temporary storage; use them for values that are going to change over the course of the script.&#60;/p&#62;
&#60;p&#62;An example of this is:&#60;br /&#62;
&#38;lt;?php&#60;br /&#62;
// assign value to variable $now = 2010;&#60;/p&#62;
&#60;p&#62;// assign variable to another variable $currentYear - $now;&#60;/p&#62;
&#60;p&#62;//perform calculation $lastYear = $currentYear -1;&#60;/p&#62;
&#60;p&#62;// output; '2009 has ended. Welcome to 2010!' echo &#34;$lastYear has ended. Welcome to $currentYear!&#34;;&#60;/p&#62;
&#60;p&#62;?&#38;gt;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jill.pettipas on "Remove all HTML tags from a string"</title>
			<link>http://forum.wddmportfolios.com/topic/remove-all-html-tags-from-a-string#post-607</link>
			<pubDate>Wed, 10 Nov 2010 10:30:13 +0000</pubDate>
			<dc:creator>jill.pettipas</dc:creator>
			<guid isPermaLink="false">607@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Use the strip_tags() function to automatically remove all HTML tags. This can be useful for forums or blog comments where users can submit content.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;$text = strip_tags($input, &#38;quot;&#38;quot;);&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stephanie.hucko on "Number Users Currently Online"</title>
			<link>http://forum.wddmportfolios.com/topic/number-users-currently-online#post-606</link>
			<pubDate>Wed, 10 Nov 2010 10:27:03 +0000</pubDate>
			<dc:creator>stephanie.hucko</dc:creator>
			<guid isPermaLink="false">606@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;This code uses a database to check the number of users that are online within a current time period.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
session_start();
include&#38;quot;db.php&#38;quot;; # Connect To the database
$active_sessions = 0;
$minutes = 5; # period considered active
if($sid = session_id()) # if there is an active session
{
    # DB connect here
    $ip = $_SERVER[&#38;#39;REMOTE_ADDR&#38;#39;]; # Get Users IP address
    # Delete users from the table if time is greater than $minutes
    mysql_query(&#38;quot;DELETE FROM

&#38;lt;code&#38;gt;&#38;lt;/code&#38;gt;&#38;lt;code&#38;gt;active_sessions&#38;lt;/code&#38;gt; WHERE
    &#38;lt;code&#38;gt;date&#38;lt;/code&#38;gt; &#38;lt; DATE_SUB(NOW(),INTERVAL $minutes MINUTE)&#38;quot;)or die(mysql_error()); 

    # Check to see if the current ip is in the table
    $sql = mysql_query(&#38;quot;SELECT * FROM active_sessions WHERE ip=&#38;#39;$ip&#38;#39;&#38;quot;);
    $row = mysql_fetch_array($sql);
    # If the ip isn&#38;#39;t in the table add it.
    if(!$row){
        mysql_query(&#38;quot;INSERT INTO &#38;lt;code&#38;gt;active_sessions&#38;lt;/code&#38;gt; (&#38;lt;code&#38;gt;ip&#38;lt;/code&#38;gt;, &#38;lt;code&#38;gt;session&#38;lt;/code&#38;gt;, &#38;lt;code&#38;gt;date&#38;lt;/code&#38;gt;)
        VALUES (&#38;#39;$ip&#38;#39;, &#38;#39;$sid&#38;#39;, NOW()) ON DUPLICATE KEY UPDATE &#38;lt;code&#38;gt;date&#38;lt;/code&#38;gt; = NOW()&#38;quot;)or die(mysql_error());
    }
    # Get all the session in the table
    $sessions = mysql_query(&#38;#39;SELECT * FROM &#38;lt;code&#38;gt;active_sessions&#38;lt;/code&#38;gt;&#38;#39;)or die(mysql_error());
    # Add up all the rows returned
    $active_sessions = mysql_num_rows($sessions);
}
    # Print the final result
    echo&#38;#39;&#38;lt;b&#38;gt;Online Now: &#38;lt;/b&#38;gt;&#38;#39;.$active_sessions;
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Save this file as onlineNow.php&#60;br /&#62;
You must also create a file &#34;db.php&#34; which will be the database set up.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>nina.lex on "Max and Min Function"</title>
			<link>http://forum.wddmportfolios.com/topic/max-and-min-function#post-605</link>
			<pubDate>Wed, 10 Nov 2010 10:24:19 +0000</pubDate>
			<dc:creator>nina.lex</dc:creator>
			<guid isPermaLink="false">605@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;The max function returns the highest number in a group or array. If multiple values can be considered of the same size, the one that is listed first will be returned. You can also compare multiple arrays. The min function returns the lowest number in a group or array. &#60;/p&#62;
&#60;p&#62;MAX Examples:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
echo max(1, 3, 5, 6, 7);  // 7
echo max(array(2, 4, 5)); // 5

// When &#38;#39;hello&#38;#39; is cast as integer it will be 0. Both the parameters are equally
// long, so the order they are given in determines the result
echo max(0, &#38;#39;hello&#38;#39;);     // 0
echo max(&#38;#39;hello&#38;#39;, 0);     // hello

echo max(&#38;#39;42&#38;#39;, 3); // &#38;#39;42&#38;#39;

// Here 0 &#38;gt; -1, so &#38;#39;hello&#38;#39; is the return value.
echo max(-1, &#38;#39;hello&#38;#39;);    // hello

// With multiple arrays of different lengths, max returns the longest
$val = max(array(2, 2, 2), array(1, 1, 1, 1)); // array(1, 1, 1, 1)

// With multiple arrays of the same length, max compares from left to right
// using lexicographic order, so in our example: 2 == 2, but 4 &#38;lt; 5
$val = max(array(2, 4, 8), array(2, 5, 7)); // array(2, 5, 7)

// If both an array and non-array are given, the array
// is always returned as it&#38;#39;s seen as the largest
$val = max(&#38;#39;string&#38;#39;, array(2, 5, 7), 42);   // array(2, 5, 7)
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;MIN Examples:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
echo min(2, 3, 1, 6, 7);  // 1
echo min(array(2, 4, 5)); // 2

echo min(0, &#38;#39;hello&#38;#39;);     // 0
echo min(&#38;#39;hello&#38;#39;, 0);     // hello
echo min(&#38;#39;hello&#38;#39;, -1);    // -1

// With multiple arrays, min compares from left to right
// so in our example: 2 == 2, but 4 &#38;lt; 5
$val = min(array(2, 4, 8), array(2, 5, 1)); // array(2, 4, 8)

// If both an array and non-array are given, the array
// is never returned as it&#38;#39;s considered the largest
$val = min(&#38;#39;string&#38;#39;, array(2, 5, 7), 42);   // string
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>alexandra.irving on "crop-to-fit images using php"</title>
			<link>http://forum.wddmportfolios.com/topic/crop-to-fit-an-image-using-php#post-604</link>
			<pubDate>Wed, 10 Nov 2010 09:31:16 +0000</pubDate>
			<dc:creator>alexandra.irving</dc:creator>
			<guid isPermaLink="false">604@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;You can use this code to crop many images at once. For example using many thumb nail images for your photo gallery.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
  //----------------------------------------------------------------
  // Crop-to-fit PHP-GD
  // Revision 2 [2009-06-01]
  // Corrected aspect ratio of the output image
  //----------------------------------------------------------------

  define( &#38;#39;DESIRED_IMAGE_WIDTH&#38;#39;, 150 );
  define( &#38;#39;DESIRED_IMAGE_HEIGHT&#38;#39;, 150 );

  $source_path = $_FILES[ &#38;#39;Image1&#38;#39; ][ &#38;#39;tmp_name&#38;#39; ];

  //
  // Add file validation code here
  //

  list( $source_width, $source_height, $source_type ) = getimagesize( $source_path );

  switch ( $source_type )
  {
    case IMAGETYPE_GIF:
      $source_gdim = imagecreatefromgif( $source_path );
      break;

    case IMAGETYPE_JPEG:
      $source_gdim = imagecreatefromjpeg( $source_path );
      break;

    case IMAGETYPE_PNG:
      $source_gdim = imagecreatefrompng( $source_path );
      break;
  }

  $source_aspect_ratio = $source_width / $source_height;
  $desired_aspect_ratio = DESIRED_IMAGE_WIDTH / DESIRED_IMAGE_HEIGHT;

  if ( $source_aspect_ratio &#38;gt; $desired_aspect_ratio )
  {
    //
    // Triggered when source image is wider
    //
    $temp_height = DESIRED_IMAGE_HEIGHT;
    $temp_width = ( int ) ( DESIRED_IMAGE_HEIGHT * $source_aspect_ratio );
  }
  else
  {
    //
    // Triggered otherwise (i.e. source image is similar or taller)
    //
    $temp_width = DESIRED_IMAGE_WIDTH;
    $temp_height = ( int ) ( DESIRED_IMAGE_WIDTH / $source_aspect_ratio );
  }

  //
  // Resize the image into a temporary GD image
  //

  $temp_gdim = imagecreatetruecolor( $temp_width, $temp_height );
  imagecopyresampled(
    $temp_gdim,
    $source_gdim,
    0, 0,
    0, 0,
    $temp_width, $temp_height,
    $source_width, $source_height
  );

  //
  // Copy cropped region from temporary image into the desired GD image
  //

  $x0 = ( $temp_width - DESIRED_IMAGE_WIDTH ) / 2;
  $y0 = ( $temp_height - DESIRED_IMAGE_HEIGHT ) / 2;

  $desired_gdim = imagecreatetruecolor( DESIRED_IMAGE_WIDTH, DESIRED_IMAGE_HEIGHT );
  imagecopy(
    $desired_gdim,
    $temp_gdim,
    0, 0,
    $x0, $y0,
    DESIRED_IMAGE_WIDTH, DESIRED_IMAGE_HEIGHT
  );

  //
  // Render the image
  // Alternatively, you can save the image in file-system or database
  //

  header( &#38;#39;Content-type: image/jpeg&#38;#39; );
  imagejpeg( $desired_gdim );

  //
  // Add clean-up code here
  //
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The HTML Form&#60;/p&#62;
&#60;p&#62;The HTML form posts the file to the processing script. You may notice the use of enctype=&#34;multipart/form-data&#34; in the following form.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;form action=&#38;quot;image-crop-demo.asp&#38;quot; method=&#38;quot;post&#38;quot; enctype=&#38;quot;multipart/form-data&#38;quot;&#38;gt;
  Upload an image for processing
  &#38;lt;input type=&#38;quot;file&#38;quot; name=&#38;quot;Image1&#38;quot;&#38;gt;
  &#38;lt;input type=&#38;quot;submit&#38;quot; value=&#38;quot;Upload&#38;quot;&#38;gt;
&#38;lt;/form&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>spencer.crone on "PHP Stylesheet Switcher"</title>
			<link>http://forum.wddmportfolios.com/topic/php-stylesheet-switcher#post-603</link>
			<pubDate>Wed, 10 Nov 2010 09:22:53 +0000</pubDate>
			<dc:creator>spencer.crone</dc:creator>
			<guid isPermaLink="false">603@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;This simple PHP script allows a user to easily change the style of their page to an alternate one, and stores a cookie that remembers their choice for a year.&#60;/p&#62;
&#60;p&#62;There are two parts necessary to implement this script. The following code will go in a file called &#34;switcher.php&#34;:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
setcookie (&#38;#39;sitestyle&#38;#39;, $set, time()+31536000,
	&#38;#39;/&#38;#39;, &#38;#39;yourdomain.com&#38;#39;, &#38;#39;0&#38;#39;);
header(&#38;quot;Location: $HTTP_REFERER&#38;quot;);
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;When the user selects an alternate stylesheet, this code will write a cookie that will keep the selected 'sitestyle' (the alternate stylesheet) in memory for a year.&#60;/p&#62;
&#60;p&#62;The second part that allows this script to work occurs on the PHP content page.&#60;/p&#62;
&#60;p&#62;In the &#38;lt;head&#38;gt; section, write your stylesheet link as follows:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;link rel=&#38;quot;stylesheet&#38;quot; type=&#38;quot;text/css&#38;quot;
	media=&#38;quot;screen&#38;quot; title=&#38;quot;User
Defined Style&#38;quot; href=&#38;quot;&#38;lt;?php echo
(!$sitestyle)?&#38;#39;defaultstyle&#38;#39;:$sitestyle ?&#38;gt;.css&#38;quot; /&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then make a link somewhere in the &#38;lt;body&#38;gt; section that allows them to switch to an alternate style, such as this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;a href=&#38;quot;./switcher.php?set=red&#38;quot;&#38;gt;
click here to change to RED style!&#38;lt;/a&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;What this does is calls on switcher.php to set the $sitestyle variable in the link tag to the name specified in the link. If they haven't selected an alternate style, the stylesheet called &#34;defaultstyle.css&#34; will be used by default.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>shannon.maguire on "Making Thumbnails for a directory of jpegs"</title>
			<link>http://forum.wddmportfolios.com/topic/making-thumbnails-for-a-directory-of-jpegs#post-602</link>
			<pubDate>Wed, 10 Nov 2010 09:21:41 +0000</pubDate>
			<dc:creator>shannon.maguire</dc:creator>
			<guid isPermaLink="false">602@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;This will make thumbnails for an entire directory of jpeg images.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
&#38;lt;?php&#60;/p&#62;
&#60;p&#62;$images = new Imagick(glob('images/*.JPG'));&#60;/p&#62;
&#60;p&#62;foreach($images as $image) {&#60;/p&#62;
&#60;p&#62;    // Providing 0 forces thumbnailImage to maintain aspect ratio&#60;br /&#62;
    $image-&#38;gt;thumbnailImage(1024,0);&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;$images-&#38;gt;writeImages();&#60;/p&#62;
&#60;p&#62;?&#38;gt;&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mark.pancorvo on "Seconds to string"</title>
			<link>http://forum.wddmportfolios.com/topic/seconds-to-string#post-601</link>
			<pubDate>Wed, 10 Nov 2010 09:18:57 +0000</pubDate>
			<dc:creator>mark.pancorvo</dc:creator>
			<guid isPermaLink="false">601@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;This function will return the duration of the given time period in days, hours, minutes and seconds.&#60;/p&#62;
&#60;p&#62;e.g. secsToStr(1234567) would return &#34;14 days, 6 hours, 56 minutes, 7 seconds&#34;&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
function secsToStr($secs) {&#60;br /&#62;
	    if($secs&#38;gt;=86400){$days=floor($secs/86400);$secs=$secs%86400;$r=$days.' day';if($days&#38;lt;&#38;gt;1){$r.='s';}if($secs&#38;gt;0){$r.=', ';}}&#60;br /&#62;
	    if($secs&#38;gt;=3600){$hours=floor($secs/3600);$secs=$secs%3600;$r.=$hours.' hour';if($hours&#38;lt;&#38;gt;1){$r.='s';}if($secs&#38;gt;0){$r.=', ';}}&#60;br /&#62;
	    if($secs&#38;gt;=60){$minutes=floor($secs/60);$secs=$secs%60;$r.=$minutes.' minute';if($minutes&#38;lt;&#38;gt;1){$r.='s';}if($secs&#38;gt;0){$r.=', ';}}&#60;br /&#62;
	    $r.=$secs.' second';if($secs&#38;lt;&#38;gt;1){$r.='s';}&#60;br /&#62;
	    return $r;&#60;br /&#62;
	}&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>thomas.borzecki on "Say Hello and Write a Test Post"</title>
			<link>http://forum.wddmportfolios.com/topic/say-hello-and-write-a-test-post#post-23</link>
			<pubDate>Thu, 27 Aug 2009 01:05:23 +0000</pubDate>
			<dc:creator>thomas.borzecki</dc:creator>
			<guid isPermaLink="false">23@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Hi Everyone,&#60;br /&#62;
I created this topic so that you could come and say hi, chat, swap info, and test out the posting system without messing up other topics.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>szabi.apro on "Unzip files with PHP"</title>
			<link>http://forum.wddmportfolios.com/topic/unzip-files-with-php#post-599</link>
			<pubDate>Wed, 10 Nov 2010 09:16:47 +0000</pubDate>
			<dc:creator>szabi.apro</dc:creator>
			<guid isPermaLink="false">599@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Make sure you have the ZZIPlib library installed. If you have WHM, go to the Apache Build page, and just build apache with the &#34;Zip&#34; checkbox checked. &#60;/p&#62;
&#60;p&#62;Unzip File PHP Code&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
$zip = zip_open(&#38;quot;zip.zip&#38;quot;);
if ($zip) {
  while ($zip_entry = zip_read($zip)) {
    $fp = fopen(&#38;quot;zip/&#38;quot;.zip_entry_name($zip_entry), &#38;quot;w&#38;quot;);
    if (zip_entry_open($zip, $zip_entry, &#38;quot;r&#38;quot;)) {
      $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
      fwrite($fp,&#38;quot;$buf&#38;quot;);
      zip_entry_close($zip_entry);
      fclose($fp);
    }
  }
  zip_close($zip);
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Zip files more often than not have more than one file inside them, when you open a zip file you need to go through each file. That is what the zip_read and zip_entry_read functions are doing.&#60;/p&#62;
&#60;p&#62;zip_read is getting all the info for each file, and zip_entry_read is getting the file contents from the info returned by zip_read.&#60;/p&#62;
&#60;p&#62;zip_entry_name returns the path of the file within the zip. If the file is in a folder inside the zip, you'll need to create the directory before trying to write the file.&#60;/p&#62;
&#60;p&#62;That's It!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dennis.erny on "PHP Preg_Match Function"</title>
			<link>http://forum.wddmportfolios.com/topic/php-preg_match-function-1#post-598</link>
			<pubDate>Wed, 10 Nov 2010 09:13:37 +0000</pubDate>
			<dc:creator>dennis.erny</dc:creator>
			<guid isPermaLink="false">598@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Similar to the Instr function in Visual Basic, the PHP Preg_Match function is used to search within a string variable for another string. If the search is successful, the function returns a value of 1 whereas if the search string is not found, a value of 0 is returned. To clarify: VB’s Instr function will actually return either a 0 or the &#60;em&#62;position&#60;/em&#62; of the search string if it is successful. For example: searching the string “Get eggs and milk from the store” for the string ‘milk’ would return a value of 1 in PHP and a value of 14 in VB.&#60;/p&#62;
&#60;p&#62;Here is some sample PHP code featuring the Preg_Match function in action:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;? php $sentence = &#38;quot;Paul’s Flash lesson last week gave Dennis a severe migraine.”;
        If (preg_match(&#38;quot;/migraine/&#38;quot;, $sentence)) { echo &#38;quot;Prescription: Tylenol 3.&#38;quot;; }
        else { echo &#38;quot;Prescription: Regular Strength Tylenol.&#38;quot;; }
    ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The above code looks for the string ‘migraine’ within $sentence and echo’s a message based on whether it returns a result of ‘true’ (1) or ‘false’ (0).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mark.daguilar on "The Mail Function"</title>
			<link>http://forum.wddmportfolios.com/topic/the-mail-function#post-597</link>
			<pubDate>Wed, 10 Nov 2010 09:11:35 +0000</pubDate>
			<dc:creator>mark.daguilar</dc:creator>
			<guid isPermaLink="false">597@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Having a form, rather than just listing your contact email on a website can be useful because you can make sure that the person sending the message provides the information that you require (i.e. First Name, Last Name etc.)&#60;/p&#62;
&#60;p&#62;Providing a form also saves you from having your email address farmed by bots which would mean you could have your inbox flooded with SPAM.&#60;/p&#62;
&#60;p&#62;The mail function is phrased as: mail (to, subject, body, headers)&#60;/p&#62;
&#60;p&#62;An example is:&#60;/p&#62;
&#60;p&#62; mail ( &#34;me@mysite.com&#34;, &#34;Contact Us Form&#34;, &#34;This is an email from your site&#34;, &#34;From: &#60;a href=&#34;mailto:you@yoursite.com&#34;&#62;you@yoursite.com&#60;/a&#62;&#34; ) &#60;/p&#62;
&#60;p&#62;After the user has provided their information via the form they will receive a reply (either &#34;Your mail was sent successfully&#34; or &#34;We encountered an error sending your mail&#34;.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php $to = &#38;quot;you@yoursite.com&#38;quot;;
$subject = &#38;quot;Contact Us&#38;quot;;
$email = $_REQUEST[&#38;#39;email&#38;#39;] ;
$message = $_REQUEST[&#38;#39;message&#38;#39;] ;
$headers = &#38;quot;From: $email&#38;quot;;
$sent = mail($to, $subject, $message, $headers) ;
if($sent) {print &#38;quot;Your mail was sent successfully&#38;quot;; }
else {print &#38;quot;We encountered an error sending your mail&#38;quot;; } ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Save the above code as contact.php&#60;/p&#62;
&#60;p&#62;What this code does is:&#60;/p&#62;
&#60;p&#62;   1. Define who you want the mail sent to. We have used &#60;a href=&#34;mailto:you@yoursite.com&#34;&#62;you@yoursite.com&#60;/a&#62; but you should replace this with your email address.&#60;/p&#62;
&#60;p&#62;   2. Define the default subject for your mail.&#60;/p&#62;
&#60;p&#62;   3. Collect the message and email fields from the form and assign them to variables&#60;/p&#62;
&#60;p&#62;   4. Create a 'from' email header&#60;/p&#62;
&#60;p&#62;   5. Send the email
&#60;/p&#62;</description>
		</item>
		<item>
			<title>hyunseung.choi on "array_union function."</title>
			<link>http://forum.wddmportfolios.com/topic/array_union-function#post-596</link>
			<pubDate>Wed, 10 Nov 2010 08:58:14 +0000</pubDate>
			<dc:creator>hyunseung.choi</dc:creator>
			<guid isPermaLink="false">596@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;It's a very simple example of an array functions.&#60;br /&#62;
PHP language has an array_intersect function.&#60;/p&#62;
&#60;pre&#62;
&#60;code&#62;
&#38;lt;?php
$a = array( 1, 3 );
$b = array( 1, 3, 5 );
$c = array_intersect( $a, $b );
print_r( $c );
// result : array( 1, 3 )
?&#38;gt;
&#60;/code&#62;
&#60;/pre&#62;
&#60;p&#62;And there's a array_merge function.&#60;/p&#62;
&#60;p&#62;But, if I want to merge two different arrays, there's a little problem.&#60;/p&#62;
&#60;pre&#62;
&#60;code&#62;
&#38;lt;?php
// using array_merge();
$a = array( 1, 3 );
$b = array( 5, 4, 3 );
$c = array_merge( $a, $b );
print_r( $c );
// result : array(1, 3, 5, 4, 3);
?&#38;gt;
&#60;/code&#62;
&#60;/pre&#62;
&#60;p&#62;Obviously, I don't want to merge like that.&#60;br /&#62;
I want to get rid of that repeated values.&#60;br /&#62;
In this case, I can use array_unique function.&#60;/p&#62;
&#60;pre&#62;
&#60;code&#62;
&#38;lt;?php
$a = array( 1, 3, 5, 4, 3 );
$b = array_unique( $a );
print_r( $b );
// result : array( 1, 3, 5, 4 );
?&#38;gt;
&#60;/code&#62;
&#60;/pre&#62;
&#60;p&#62;Now, I can put this together in a new function.&#60;/p&#62;
&#60;pre&#62;
&#60;code&#62;
&#38;lt;?php
// define new function
function array_union($a, $b)
{
  return array_unique( array_merge( $a, $b) );
}
// Usage of this function.
$a = array( 1, 3 );
$b = array( 5, 4, 3 );
$c = array_union( $a, $b );
print_r( $c );
// result : array( 1, 3, 5, 4 );
?&#38;gt;
&#60;/code&#62;
&#60;/pre&#62;
&#60;p&#62;Maybe I could put sort function to correct order. :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>caroline.mcgregor on "Single-quotes versus double-quotes in a string"</title>
			<link>http://forum.wddmportfolios.com/topic/single-quotes-versus-double-quotes-in-a-string#post-595</link>
			<pubDate>Wed, 10 Nov 2010 08:57:00 +0000</pubDate>
			<dc:creator>caroline.mcgregor</dc:creator>
			<guid isPermaLink="false">595@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;For us new PHPers, if you have been unsure at times of which to use, single-quotes or double-quotes for your strings, hopefully this will clear up any confusion.&#60;/p&#62;
&#60;p&#62;In PHP, single-quoted strings and double-quoted strings are not the same. Single-quoted strings are stored as a literal translation - meaning what you see is what you get. Variables enclosed in double-quotes will be have their value used.&#60;/p&#62;
&#60;p&#62;Example:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$year = 2010;
$answer1 = &#38;quot;$year&#38;quot;;
$answer2 = &#38;#39;$year&#38;#39;;
echo $answer1;
echo $answer2;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The result would be:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;2010
&#38;#39;$year&#38;#39;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The same is true when you have quotes that enclose an entire string - the outer quotes determine how the string is treated, even if you have other quotes inside that string.&#60;/p&#62;
&#60;p&#62;Example:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$year = 2010;
$statement1 = &#38;quot;The year is &#38;#39;$year &#38;#39;.&#38;quot;;
$statement2 = &#38;#39;The year is &#38;quot; $year&#38;quot;.&#38;#39;;
echo $statement1;
echo $statement2;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The result would be:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;The year is &#38;#39;2010&#38;#39;.
The year is &#38;quot;$year&#38;quot;.&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Remember - the exception to the quote rule in strings is the use of the backslash in front of the quote \' or \&#34; (which we all ready know means to ignore the succeeding quote).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>graine.wightman on "Using the glob() function to find files"</title>
			<link>http://forum.wddmportfolios.com/topic/using-the-glob-function-to-find-files#post-594</link>
			<pubDate>Tue, 09 Nov 2010 23:08:17 +0000</pubDate>
			<dc:creator>graine.wightman</dc:creator>
			<guid isPermaLink="false">594@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Somewhat similar to the scandir() function, the glob() function allows you to search for files matching a specified pattern and returns an array of filenames or directories:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
$files=glob(‘*.txt’);

print_r($files);
?&#38;gt;

/*Output looks like:

Array
(
[0] =&#38;gt; apples.txt
[1] =&#38;gt; bread.txt
[2] =&#38;gt; elephants.txt
[3] =&#38;gt; sailboats.txt
)
*/&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Files can also be returned with a path if directions are specified in the query:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
$files = glob(‘../images/a*.jpg’);

print_r($files);
?&#38;gt;

/*Output looks like:

Array
(
[0] =&#38;gt; ../images/alligator.jpg’
[1] =&#38;gt; ../images/amazon.jpg’
[2] =&#38;gt; ../images/anaconda.jpg’
)
*/&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The full path to each file can be requested by using the realpath() function on the returned values:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
$files = glob(‘../images/a*.jpg’);

/*using this applies the function to each array map*/
$files = array_map(&#38;#39;realpath&#38;#39;,$files);   

print_r($files);
?&#38;gt;

/*Output looks like:

Array
(
[0] =&#38;gt; C:\wamp\www\images/alligator.jpg’
[1] =&#38;gt; C:\wamp\www\images/amazon.jpg’
[2] =&#38;gt; C:\wamp\www\images/anaconda.jpg’
)
*/&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Please note:  This function does not work on remote files. The files being searched must be accessible on the server's file system.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>arnold.mababangloob on "PHP: Compressing Strings"</title>
			<link>http://forum.wddmportfolios.com/topic/php-compressing-strings#post-593</link>
			<pubDate>Tue, 09 Nov 2010 21:48:15 +0000</pubDate>
			<dc:creator>arnold.mababangloob</dc:creator>
			<guid isPermaLink="false">593@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Not only can we compress files, but we can also compress strings using a function called gzcompress().  To uncompress the string we then use gzuncompress().&#60;/p&#62;
&#60;p&#62;Example:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$string = &#38;quot;Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Pellentesque congue semper facilisis. Aliquam convallis risus eu ante
posuere placerat. Aliquam in nisl nec justo ultrices ornare nec ac mi.
 Cras ac leo sapien, id luctus elit. Aenean sem ligula, porttitor in
 blandit ut, lacinia eu felis. Nullam rhoncus luctus dolor, et lobortis
 augue vehicula ornare. Nunc rutrum ipsum eu justo venenatis vitae tempor
 leo ultrices. Cras ac lacus eu metus ultrices iaculis. Integer dignissim
 tristique enim, sed cursus leo pellentesque id. Nullam convallis commodo
 rhoncus. Maecenas quis sem metus, et tempus odio. Nam et lacus libero, non
 feugiat elit. Aenean at eros sem. Proin lectus tortor, euismod at sagittis
 eget, ullamcorper sit amet urna. Phasellus ullamcorper auctor suscipit.
 Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere
 cubilia Curae; Nullam tempus bibendum velit quis suscipit. &#38;quot;;

$compressed = gzcompress($string);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;We can then compare the size of the two strings:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;echo &#38;quot;Original length: &#38;quot;. strlen($string).&#38;quot;&#38;quot;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Prints, &#34;Original length: 910&#34;&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;echo &#38;quot;Compressed length: &#38;quot;. strlen($compressed).&#38;quot;&#38;quot;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Prints, &#34;Compressed length: 476&#34;.  So we almost reduced the length of the string by 50%.&#60;/p&#62;
&#60;p&#62;To uncompress the string we then use the gzuncompress() function:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$uncompressed = gzuncompress($compressed);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;And in case you were wondering, if you try to echo out the compressed file, the output is just a bunch of gobbledygook random symbols mixed with some actual real characters.&#60;/p&#62;
&#60;p&#62;Maybe I should also compress my last name so it doesn't flow onto the post area.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>

