<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 Posts</title>
		<link>http://forum.wddmportfolios.com/</link>
		<description>WDDM Student Community</description>
		<language>en-US</language>
		<pubDate>Wed, 22 Feb 2012 20:52:25 +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/" 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-626</link>
			<pubDate>Wed, 26 Jan 2011 15:52:55 +0000</pubDate>
			<dc:creator>preet.walia</dc:creator>
			<guid isPermaLink="false">626@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Thanks guys I did it with the help of bigdump.php script file.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>thomas.borzecki on "Upload a large SQL file"</title>
			<link>http://forum.wddmportfolios.com/topic/upload-a-large-sql-file#post-625</link>
			<pubDate>Fri, 21 Jan 2011 14:11:53 +0000</pubDate>
			<dc:creator>thomas.borzecki</dc:creator>
			<guid isPermaLink="false">625@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Also, try using a MySQL client, rather than PHPMyAdmin to do the import.  Dedicated software can make socket MySQL connections to your MySQL server, rather than the HTTP connections you would be making through the browser.  I have imported fairly large files with this method using SequelPro (MacOS, free).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>kevin.thackorie on "Upload a large SQL file"</title>
			<link>http://forum.wddmportfolios.com/topic/upload-a-large-sql-file#post-624</link>
			<pubDate>Fri, 14 Jan 2011 10:15:05 +0000</pubDate>
			<dc:creator>kevin.thackorie</dc:creator>
			<guid isPermaLink="false">624@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;I'm not sure if this is what you mean, but when trying to import a large .sql file, you may encounter failures due to the sheer size of certain records/tables. Try playing with the configuration settings for MySQL (ex. the file on your web server or &#34;my.ini&#34; if using XAMPP locally at ...xampp\mysql\bin), specifically the &#34;max_allowed_packet&#34; parameter. For instance, I once had to change it from the default 2M to 25M to get a file import to work - the file was nowhere near 600MB, though.&#60;/p&#62;
&#60;p&#62;I hope this helps!
&#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>thomas.borzecki 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-622</link>
			<pubDate>Tue, 11 Jan 2011 23:35:47 +0000</pubDate>
			<dc:creator>thomas.borzecki</dc:creator>
			<guid isPermaLink="false">622@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;I have once said those words ... now we need the AS3 version too :)
&#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 "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>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-619</link>
			<pubDate>Thu, 09 Dec 2010 12:14:29 +0000</pubDate>
			<dc:creator>kevin.thackorie</dc:creator>
			<guid isPermaLink="false">619@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;This position has been filled.
&#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-618</link>
			<pubDate>Wed, 08 Dec 2010 21:45:09 +0000</pubDate>
			<dc:creator>mike.clark</dc:creator>
			<guid isPermaLink="false">618@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;A few more links ...&#60;/p&#62;
&#60;p&#62;There was a question from the back regarding how to actually put together a decent web design (practical tips on how to mock it up and come up with something successful, etc.). That's obviously a broad question, but one I've asked myself. Here are a few links to resources that will walk you through the process.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://astore.amazon.com/simplebits-20/detail/0321643380&#34; rel=&#34;nofollow&#34;&#62;http://astore.amazon.com/simplebits-20/detail/0321643380&#60;/a&#62; &#38;lt;-- Dan Cederholm knows CSS inside and out and his books have very current and easy to follow information. This one contains a good &#34;project site&#34; for a fake coffee shop. He'll walk you through the design and code process.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://webdesign.tutsplus.com/tutorials/complete-websites/design-a-professional-clean-community-blog-theme-in-adobe-photoshop/&#34; rel=&#34;nofollow&#34;&#62;http://webdesign.tutsplus.com/tutorials/complete-websites/design-a-professional-clean-community-blog-theme-in-adobe-photoshop/&#60;/a&#62; &#38;lt;-- Another tutorial on how to mock up a design from scratch using Photoshop. Working from a grid is very important. It'll add an overall sense of consistency and order to your layout which will tie it all together. Don't be afraid to break your grid in some areas. Establish organization, then break it occasionally to make elements jump out.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://webdesign.tutsplus.com/articles/design-theory/understanding-the-f-layout-in-web-design/&#34; rel=&#34;nofollow&#34;&#62;http://webdesign.tutsplus.com/articles/design-theory/understanding-the-f-layout-in-web-design/&#60;/a&#62; &#38;lt;-- The first two links I posted were more step by step tutorials for using Photoshop and writing code. This one is about the theory of the layout style.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://webdesign.tutsplus.com/articles/design-theory/understanding-the-z-layout-in-web-design/&#34; rel=&#34;nofollow&#34;&#62;http://webdesign.tutsplus.com/articles/design-theory/understanding-the-z-layout-in-web-design/&#60;/a&#62; &#38;lt;-- Another article on a different layout style.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.alistapart.com/articles/redesigning-your-own-site/&#34; rel=&#34;nofollow&#34;&#62;http://www.alistapart.com/articles/redesigning-your-own-site/&#60;/a&#62; &#38;lt;-- An &#34;A List Apart&#34; article on redesigning your own site, definitely something I've struggled with.&#60;/p&#62;
&#60;p&#62;Someone else asked about how to express your personality if you're applying to an interesting design/development shop and I suggested adding your voice and style to your website. Here are a few design galleries where you can see lots of examples of this sort of thing for inspiration:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://onepagelove.com/category/portfolio&#34; rel=&#34;nofollow&#34;&#62;http://onepagelove.com/category/portfolio&#60;/a&#62; &#38;lt;-- I started off with a one-page website and may do that again. Simple and succinct.&#60;br /&#62;
&#60;a href=&#34;http://welovewp.com/category/portfolio-gallery&#34; rel=&#34;nofollow&#34;&#62;http://welovewp.com/category/portfolio-gallery&#60;/a&#62; &#38;lt;-- All these sites are done with WordPress. Get on that trolly.&#60;/p&#62;
&#60;p&#62;If I blanked on another question from the class and haven't answered it yet just ask away again and I'll get back to you. Fire away with any new questions too.&#60;/p&#62;
&#60;p&#62;- Mike
&#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-617</link>
			<pubDate>Wed, 08 Dec 2010 20:37:14 +0000</pubDate>
			<dc:creator>mike.clark</dc:creator>
			<guid isPermaLink="false">617@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Hi all, &#60;/p&#62;
&#60;p&#62;I hope you enjoyed today's talk and found it useful. Below are links to some topics worth looking into on your own time (they're all from the whiteboard). I'll also include a link to our slides from today and some things mentioned in those. If you have any questions, feel free to ask us here or hit us up on Twitter.&#60;/p&#62;
&#60;p&#62;- Mike&#60;/p&#62;
&#60;p&#62;Stuff to Google:&#60;br /&#62;
- WordPress (&#60;a href=&#34;http://wordpress.org/&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.org/&#60;/a&#62;) &#38;lt;-- open source CMS&#60;br /&#62;
- Drupal (&#60;a href=&#34;http://drupal.org/&#34; rel=&#34;nofollow&#34;&#62;http://drupal.org/&#60;/a&#62;) &#38;lt;-- open source CMS&#60;br /&#62;
- Basecamp (&#60;a href=&#34;http://basecamphq.com/&#34; rel=&#34;nofollow&#34;&#62;http://basecamphq.com/&#60;/a&#62;) &#38;lt;-- project management service (paid)&#60;br /&#62;
- Open Atrium (&#60;a href=&#34;http://openatrium.com/&#34; rel=&#34;nofollow&#34;&#62;http://openatrium.com/&#60;/a&#62;) &#38;lt;-- project management software (free)&#60;br /&#62;
- jQuery (&#60;a href=&#34;http://jquery.com/&#34; rel=&#34;nofollow&#34;&#62;http://jquery.com/&#60;/a&#62;) &#38;lt;-- JavaScript framework&#60;br /&#62;
- Dribbble (&#60;a href=&#34;http://dribbble.com/&#34; rel=&#34;nofollow&#34;&#62;http://dribbble.com/&#60;/a&#62;) &#38;lt;-- designs-in-progress showcase (message me if you need an invite)&#60;br /&#62;
- Billings (&#60;a href=&#34;http://www.marketcircle.com/billings/&#34; rel=&#34;nofollow&#34;&#62;http://www.marketcircle.com/billings/&#60;/a&#62;) &#38;lt;-- time tracking/billing software&#60;br /&#62;
- Freshbooks (&#60;a href=&#34;http://www.freshbooks.com/&#34; rel=&#34;nofollow&#34;&#62;http://www.freshbooks.com/&#60;/a&#62;) &#38;lt;-- time tracking/billing software&#60;br /&#62;
- Quirksmode (&#60;a href=&#34;http://www.quirksmode.org/&#34; rel=&#34;nofollow&#34;&#62;http://www.quirksmode.org/&#60;/a&#62;) &#38;lt;-- IE6 bugs information&#60;br /&#62;
- Position is Everything (&#60;a href=&#34;http://www.positioniseverything.net/&#34; rel=&#34;nofollow&#34;&#62;http://www.positioniseverything.net/&#60;/a&#62;) &#38;lt;-- IE6 bugs information&#60;br /&#62;
- Stack Overflow (&#60;a href=&#34;http://stackoverflow.com/&#34; rel=&#34;nofollow&#34;&#62;http://stackoverflow.com/&#60;/a&#62;) &#38;lt;-- technical Q&#38;amp;A site&#60;br /&#62;
- Tuts Plus Network (&#60;a href=&#34;http://tutsplus.com/&#34; rel=&#34;nofollow&#34;&#62;http://tutsplus.com/&#60;/a&#62;) &#38;lt;-- Parent company of numerous tutorial sites (Nettuts, Webdesigntuts, Psdtuts, Vectortuts, etc.)&#60;br /&#62;
- A List Apart (&#60;a href=&#34;http://www.alistapart.com/&#34; rel=&#34;nofollow&#34;&#62;http://www.alistapart.com/&#60;/a&#62;) &#38;lt;-- Online web design magazine, great articles&#60;br /&#62;
- yayQuery (&#60;a href=&#34;http://yayquery.com/&#34; rel=&#34;nofollow&#34;&#62;http://yayquery.com/&#60;/a&#62;) &#38;lt;-- Hilarious video podcast on all things JavaScript and jQuery&#60;br /&#62;
- HTML5 Boilerplate (&#60;a href=&#34;http://html5boilerplate.com/&#34; rel=&#34;nofollow&#34;&#62;http://html5boilerplate.com/&#60;/a&#62;) &#38;lt;-- great starter for creating a site - TONS of cool tricks in the source&#60;br /&#62;
- #hohoTO (&#60;a href=&#34;http://hohoto.ca/&#34; rel=&#34;nofollow&#34;&#62;http://hohoto.ca/&#60;/a&#62;) &#38;lt;-- Upcoming charity event with the whole Toronto web community in attendance&#60;/p&#62;
&#60;p&#62;Presentation slides: &#60;a href=&#34;https://docs.google.com/present/view?id=dcxrv3q7_44drmqhzhg&#34; rel=&#34;nofollow&#34;&#62;https://docs.google.com/present/view?id=dcxrv3q7_44drmqhzhg&#60;/a&#62;&#60;br /&#62;
Andy Clarke's &#34;Killer Contract&#34;: &#60;a href=&#34;http://stuffandnonsense.co.uk/content/dl/2010/05/11/contract-killer-2nd-hit.txt&#34; rel=&#34;nofollow&#34;&#62;http://stuffandnonsense.co.uk/content/dl/2010/05/11/contract-killer-2nd-hit.txt&#60;/a&#62; (rephrase the emo bits)&#60;br /&#62;
Happy Cog's creative brief: &#60;a href=&#34;http://happycog.com/contact/contact.doc&#34; rel=&#34;nofollow&#34;&#62;http://happycog.com/contact/contact.doc&#60;/a&#62; (trim this down to the essentials and paraphrase it - no copy/paste!)&#60;/p&#62;
&#60;p&#62;Mike Clark: @shapelike&#60;br /&#62;
Mike Pezzi: @mikepezzi&#60;br /&#62;
Nalin Sharma: @nalins
&#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-616</link>
			<pubDate>Fri, 03 Dec 2010 12:39:57 +0000</pubDate>
			<dc:creator>francis.san.juan</dc:creator>
			<guid isPermaLink="false">616@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;Also, does anyone know what are good requirements for usernames? If there are better standard requirements than those I've specified above? I realize I haven't included a requirement for the username length (max and min # of characters).
&#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>ryan.casey on "Say Hello and Write a Test Post"</title>
			<link>http://forum.wddmportfolios.com/topic/say-hello-and-write-a-test-post/page/3#post-600</link>
			<pubDate>Wed, 10 Nov 2010 09:18:12 +0000</pubDate>
			<dc:creator>ryan.casey</dc:creator>
			<guid isPermaLink="false">600@http://forum.wddmportfolios.com/</guid>
			<description>&#60;p&#62;function checkDateFormat($date)&#60;br /&#62;
02	{&#60;br /&#62;
03	    //match the format of the date&#60;br /&#62;
04	    if (preg_match (&#34;/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/&#34;, $date, $parts))&#60;br /&#62;
05	    {&#60;br /&#62;
06	        //check weather the date is valid of not&#60;br /&#62;
07	        if(checkdate($parts[2],$parts[3],$parts[1]))&#60;br /&#62;
08	            return true;&#60;br /&#62;
09	        else&#60;br /&#62;
10	        return false;&#60;br /&#62;
11	    }&#60;br /&#62;
12	    else&#60;br /&#62;
13	        return false;&#60;br /&#62;
14	}&#60;/p&#62;
&#60;p&#62;This script makes sure that first, the date is in the correct format. Then it makes sure that the date is correct.
&#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>

	</channel>
</rss>

