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

<channel>
	<title>Jotlab &#187; web</title>
	<atom:link href="http://www.jotlab.com/tag/web/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jotlab.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Fri, 22 Mar 2013 01:15:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Protecting Files Against Hotlinking with PHP, Lighttpd, Apache &amp; X-Sendfile</title>
		<link>http://www.jotlab.com/2010/protecting-files-against-hotlinking-with-php-lighttpd-apache-x-sendfile</link>
		<comments>http://www.jotlab.com/2010/protecting-files-against-hotlinking-with-php-lighttpd-apache-x-sendfile#comments</comments>
		<pubDate>Wed, 11 Aug 2010 01:53:33 +0000</pubDate>
		<dc:creator>voidet</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[hot]]></category>
		<category><![CDATA[hotlinking]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[linking]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://www.jotlab.com/?p=4528</guid>
		<description><![CDATA[I recently had to lock down some important files that first required some level of authentication. The problem was the only way to guard against hotlinking or direct access to these files was to pipe the data through php after an Auth check. Using fread,... <span><a href="http://www.jotlab.com/2010/protecting-files-against-hotlinking-with-php-lighttpd-apache-x-sendfile" title="Protecting Files Against Hotlinking with PHP, Lighttpd, Apache &#038; X-Sendfile" rel="bookmark">[+]</a></span>]]></description>
				<content:encoded><![CDATA[<p>I recently had to lock down some important files that first required some level of authentication. The problem was the only way to guard against hotlinking or direct access to these files was to pipe the data through php after an Auth check. Using fread, readfile or file_get_contents produced extreme CPU usage, not really to my surprise. Usually I wouldn&#8217;t care about high CPU usage on smaller projects, however this was causing the webserver to become unresponsive as it had to fully parse the files.</p>
<p>I went searching and eventually came across a module for both Apache and Lighttpd called X-Sendfile. The module works by sending headers out to the webserver to simply output a static file, without touching PHP&#8217;s file handling functions. First we need to install the module before we can start sending headers out to the webserver.</p>
<h3>Apache:</h3>
<ol>
<li>Login as root or your administrator account</li>
<li>Download the following code to your server <a href="http://tn123.ath.cx/mod_xsendfile/mod_xsendfile.c">mod_xsendfile.c</a></li>
<li>Installing is simple with: sudo apxs -cia mod_xsendfile.c</li>
<li>You will now notice the messages on the screen stating it has been added to your Apache config file and copied to the apache modules directory</li>
<li>Restart Apache. Done <img src='http://www.jotlab.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<h3>Lighttpd</h3>
<p>Setting up X-Sendfile on Lighttpd is much simpler as the module is shipped with Lighttpd 1.4+. All we will need to do is add in the &#8220;allow-x-send-file&#8221; => &#8220;enable&#8221; setting to our fastcgi.server array:</p>
<pre class="brush: php; title: ; notranslate">fastcgi.server = ( &quot;.php&quot; =&gt;
  ( &quot;localhost&quot; =&gt;
    (&quot;socket&quot; =&gt; &quot;/opt/local/var/run/lighttpd/php-fastcgi.socket&quot;,
     &quot;allow-x-send-file&quot; =&gt; &quot;enable&quot;,
     .......etc
    )
  )
)</pre>
<h3>PHP &#038; Lighttpd</h3>
<p>Next up we will handle some basic user authentication with PHP to show how you can protect your files with PHP:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php

if (!empty($_SESSION['logged_in'])) {
  header( &quot;Content-Disposition: attachment; filename=&quot;The Name You Want Your Users To See.mp3&quot;&quot;);
  header( &quot;X-LIGHTTPD-send-file: /full/path/to/your/file.mp3&quot;);
} else {
  echo &quot;Sorry, You're not on the list, You're not coming in!&quot;;
}

?&gt;</pre>
<p>If you&#8217;re using Lighttpd version 1.5 then you can replace &#8220;X-LIGHTTPD-send-file&#8221; with &#8220;X-Sendfile&#8221;.</p>
<h3>PHP &#038; Apache</h3>
<p>Using X-Sendfile with Apache is very similar, however we need to turn X-Sendfile on. Either put &#8220;XSendFile On&#8221; in a .htaccess files where your script resides, or put this in your Apache config file. The php configuration is pretty much exactly like Lighttpd 1.5 handling:</p>
<pre class="brush: php; title: ; notranslate">&lt;?php

if (!empty($_SESSION['logged_in'])) {
  header( &quot;Content-Disposition: attachment; filename=&quot;The Name You Want Your Users To See.mp3&quot;&quot;);
  header( &quot;X-Sendfile: /full/path/to/your/file.mp3&quot;);
} else {
  echo &quot;Sorry, You're not on the list, You're not coming in!&quot;;
}

?&gt;</pre>
<p>Feel free to move your files outside of the root path of the webserver which will prevent hotlinking, or as always, &#8220;deny from all&#8221; will do the trick in a .htaccess file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jotlab.com/2010/protecting-files-against-hotlinking-with-php-lighttpd-apache-x-sendfile/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Michi Schwimann &#8211; Beta Design. Thoughts?</title>
		<link>http://www.jotlab.com/2009/michi-schwimann-beta-design-thoughts</link>
		<comments>http://www.jotlab.com/2009/michi-schwimann-beta-design-thoughts#comments</comments>
		<pubDate>Mon, 30 Mar 2009 04:48:36 +0000</pubDate>
		<dc:creator>voidet</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[michi schwimann]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.jotlab.com/?p=3716</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><a href="http://new.jotlab.com/wp-content/uploads/2009/03/michi1.jpg"><img class="alignleft size-medium wp-image-3715" title="michi" src="http://new.jotlab.com/wp-content/uploads/2009/03/michi1-500x500.jpg" alt="michi" width="500" height="500" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jotlab.com/2009/michi-schwimann-beta-design-thoughts/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CakePHP Manual: People with no internet</title>
		<link>http://www.jotlab.com/2009/cakephp-manual-people-with-no-internet</link>
		<comments>http://www.jotlab.com/2009/cakephp-manual-people-with-no-internet#comments</comments>
		<pubDate>Thu, 26 Feb 2009 02:13:53 +0000</pubDate>
		<dc:creator>voidet</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[cake]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.jotlab.com/?p=3524</guid>
		<description><![CDATA[My net is capped at a lame speed of 6kbs. That&#8217;s what happens when you try to enjoy content on the internet and live in Australia. So when i&#8217;m trying to get some documentation for my CakePHP project i end up waiting like 5minutes for... <span><a href="http://www.jotlab.com/2009/cakephp-manual-people-with-no-internet" title="CakePHP Manual: People with no internet" rel="bookmark">[+]</a></span>]]></description>
				<content:encoded><![CDATA[<p>My net is capped at a lame speed of 6kbs. That&#8217;s what happens when you try to enjoy content on the internet and live in Australia. So when i&#8217;m trying to get some documentation for my CakePHP project i end up waiting like 5minutes for the damn page to load. Instead i found that you can get the complete manual on one page, save that with images to desktop, and always have a fast manual handy!</p>
<p>http://book.cakephp.org/complete/3/The-Manual</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jotlab.com/2009/cakephp-manual-people-with-no-internet/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My First Contact With CakePHP</title>
		<link>http://www.jotlab.com/2009/my-first-contact-with-cakephp</link>
		<comments>http://www.jotlab.com/2009/my-first-contact-with-cakephp#comments</comments>
		<pubDate>Wed, 25 Feb 2009 14:43:19 +0000</pubDate>
		<dc:creator>voidet</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[2.0]]></category>
		<category><![CDATA[cake]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.jotlab.com/?p=3513</guid>
		<description><![CDATA[If you have been reading the blog lately you will of noticed that I have changed my development path from Django using Python to CakePHP, tada, using PHP. I spent quite alot of time attempting to elarn both Python and the Django framework together. Much... <span><a href="http://www.jotlab.com/2009/my-first-contact-with-cakephp" title="My First Contact With CakePHP" rel="bookmark">[+]</a></span>]]></description>
				<content:encoded><![CDATA[<p>If you have been reading the blog lately you will of noticed that I have changed my development path from Django using Python to CakePHP, tada, using PHP. I spent quite alot of time attempting to elarn both Python and the Django framework together. Much like learning Ruby on Rails or another language and framework combination, if you don&#8217;t know the language before dealing with the framework the learning curve can be quite high, in my experience and opinion. So I decided to jump back into PHP and find a framework that suits what i need and how i work. One of my good friends recommended that i take a look at CakePHP. So i did.</p>
<p>Before i got started with CakePHP however i decided that i had better take a look at other frameworks i had heard were like CakePHP. Two of them was Symfony and CodeIgniter. Not hearing much about Symfony but a fair bit on google about CodeIgniter i decided to look up comparisons as to when to use CI and when to use CakePHP. I wanted to stear clear of libraries and instead work closely with a firm Model View Controller (MVC) methodology. Alot of the posts, infact all that i read, pointed to CodeIgniter being awesome for smaller projects as it can be considered a bit of a box of magic tricks. From what i read CI is more so a library kit with standardised methods, whereas CakePHP is a strong framework which still has the automagic found in CI.</p>
<p>So i bought a bunch of CakePHP books and began to read through the structure of MVC design patterns and how to use CakePHP with models, controllers and views, along with its helpers, actions, behaviours, elements etc. CakePHP is amazingly easy to pick up. The structure of accessing the models, and structuring the models is amazing. I think this is where most of the magic comes into it. Form validation is generated and controlled through the model definitions, handled through controllers and displayed with the views. I like this method of putting alot of weight on the Models access, it reinforces the proposed database structure and enforces data integrity. Instead of dealing with regexs in the controller across many controllers that access the same models and possibly a bunch of different views and their forms.</p>
<p>This is a bit of a ramble post i know. Its a bit late and time for bed. I just wanted to do a quick post on how much i&#8217;m enjoying the development speed, impressive structure and logic that i work with, with CakePHP. I think if i had still been carrying on with Django, although impressive, i would still be losing hair at a much faster pace that i am now! Only a week into CakePHP and i can easily say my project is around the 40% mark <img src='http://www.jotlab.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Yay! Sorry for the rambling, it is indeed time for bed, hope to get some time to write a well structured post and not just a blog entry.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jotlab.com/2009/my-first-contact-with-cakephp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP: Using Apress &amp; Packt</title>
		<link>http://www.jotlab.com/2009/cakephp-using-apress-packt</link>
		<comments>http://www.jotlab.com/2009/cakephp-using-apress-packt#comments</comments>
		<pubDate>Sun, 22 Feb 2009 03:35:54 +0000</pubDate>
		<dc:creator>voidet</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[apress]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[cake]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[packt]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[publishing]]></category>
		<category><![CDATA[systems]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.jotlab.com/?p=3490</guid>
		<description><![CDATA[I love buying books. Taking one look at my bookcase makes this quite obvious. I do have quite a large selection of computer related books. I find that by reading into the subject matter, especially for programming, before acting on ideas or tasks provides a... <span><a href="http://www.jotlab.com/2009/cakephp-using-apress-packt" title="CakePHP: Using Apress &#038; Packt" rel="bookmark">[+]</a></span>]]></description>
				<content:encoded><![CDATA[<p>I love buying books. Taking one look at my bookcase makes this quite obvious. I do have quite a large selection of computer related books. I find that by reading into the subject matter, especially for programming, before acting on ideas or tasks provides a person with the tools and knowledge to get stuff done. I can&#8217;t help but think when i start a new project and get into development using new tools that i don&#8217;t know what i&#8217;m doing 100% and i don&#8217;t know if what i am doing is necessarily the best or most efficient way of achieving the goals set out. So i buy and read books!</p>
<p>I have found a trend though with the books i have bought and read. I tend to buy both Apress books and Packt publishing books. Both seem to come out around the same time, maybe Packt a little bit later. Apress has an awesome series, which can also be thought of as a more practical version of an online documentation. Its the beginner to novice series. I recently bought the Apress Beginner to Novice&#8217;s guide to CakePHP. It covers an in depth look at all the functions of the framework, lets you learn the functions and how to extend upon them. Its pretty much a complete overview of all the tools. Packt Publishing on the other hand has their CakePHP book, which as always with Packt Publishing, is more a practical look at CakePHP&#8217;s functions. It takes you through project after project, extending on previous steps and analysing new functions and how they can be applied. </p>
<p>I like reading the Apress beginner to novice series books first, and then the Packt Publishing books secondly. Apress teaches me all the functions and what CakePHP is packed with, and then Packt Publishing takes over and shows how use all the functions and the methods. Apress do however have some practical examples, for example in their CakePHP book it builds on a blog example. The CakePHP projects book by Apress however has had a bad wrap, so i think i will read that one later, when i know more about CakePHP. Anyways, if any of you have either of the three books let me know what you think about them! Or any CakePHP developers please hit me up with a comment!  <img src='http://www.jotlab.com/wp-includes/images/smilies/icon_wink.gif' alt=':wink:' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jotlab.com/2009/cakephp-using-apress-packt/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why We Hate Blurb &amp; UPS</title>
		<link>http://www.jotlab.com/2009/why-we-hate-blurb</link>
		<comments>http://www.jotlab.com/2009/why-we-hate-blurb#comments</comments>
		<pubDate>Tue, 06 Jan 2009 02:47:39 +0000</pubDate>
		<dc:creator>voidet</dc:creator>
				<category><![CDATA[Ideas]]></category>
		<category><![CDATA[bad]]></category>
		<category><![CDATA[blurb]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[delivery]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[let down]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[poor]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[terrible]]></category>
		<category><![CDATA[UPS]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web2.0]]></category>

		<guid isPermaLink="false">http://www.jotlab.com/?p=3105</guid>
		<description><![CDATA[Blurb, an online service, web2.0 whatever, where their customers can create their own books from their own content. My girlfriend had an awesome idea/surprise whereby she spent hours of time working away at making me my own book based on my current travels in Canada.... <span><a href="http://www.jotlab.com/2009/why-we-hate-blurb" title="Why We Hate Blurb &#038; UPS" rel="bookmark">[+]</a></span>]]></description>
				<content:encoded><![CDATA[<p>Blurb, an online service, web2.0 whatever, where their customers can create their own books from their own content. My girlfriend had an awesome idea/surprise whereby she spent hours of time working away at making me my own book based on my current travels in Canada. This book was meant to be given to me as a Christmas Present. However a couple of days later she found out it would not arrive till Boxing Day (26th December). So she had to ruin the surprise and show me the book in an online format, or so she felt. The idea was very nice, but then again we didn&#8217;t really need Blurb to make a collage of photos and text and display them on the computer. </p>
<p>After viewing the book we found out that the book was further delayed, they offered us $10 off our next book that we order off them, yeah right. The book was finally shipped on the 30th of December, via Expedited UPS service. Expecting the book to arrive in two to three days later we monitored the whereabouts of the package very eagerly. It came to the 5th of January, where the book was via our tracking meant to arrive. It didn&#8217;t. We called UPS and they assured us it would arrive after the weekend, on the Monday; promptly on the Monday. Waiting around the house all day, no package. We called UPS at 4pm on Monday, they assured us it would come on the day and deliveries go to 8pm, yeah right they do. </p>
<p>8pm came. No package. We called and they had no answer. They simply asked for our contact details and someone would call the following day as to the delivery of the package. We are over it. Tomorrow we are flying to another province in Canada, and now we will have to pay further shipping costs to mail ourselves the package. We spent most of the day Googling videos on UPS, how their delivery staff throw packages across the street to the doorstep. Entertaining, but just another reminder why we will not be using any of UPS services, ever. In fact i will boycott the services of UPS and refuse to purchase any products from any company that ships via UPS.</p>
<p>As to Blurb. Well i know they are an online service, that however does not remove the fact that they must provide a degree of service that customers will be content with. We certainly are not content with a $10 coupon. Firstly they shipped late, they broke their shipping promises, and they ship with UPS. So what will happen next? We will wait for the package, if it is in anyway damaged via Blurb&#8217;s quality of service or the UPS man throwing boxes across the street i am going to go on the biggest anti Blurb and UPS rant of all time! Use this information in this post as merely our experience with both services, competitors feel free to distribute this information in anyway you see fit!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jotlab.com/2009/why-we-hate-blurb/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tutorial: How to build a poll system with PHP and mySQL</title>
		<link>http://www.jotlab.com/2008/tutorial-how-to-build-a-poll-system-in-php-and-mysql</link>
		<comments>http://www.jotlab.com/2008/tutorial-how-to-build-a-poll-system-in-php-and-mysql#comments</comments>
		<pubDate>Fri, 11 Apr 2008 04:03:21 +0000</pubDate>
		<dc:creator>voidet</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[poll]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.jotlab.com/?p=1018</guid>
		<description><![CDATA[If you have been doing the other tutorials on this site you will notice that I have been teaching PHP and mySQL through projects. Projects that you can slot into your website, or if you are building a project, code that you can use within... <span><a href="http://www.jotlab.com/2008/tutorial-how-to-build-a-poll-system-in-php-and-mysql" title="Tutorial: How to build a poll system with PHP and mySQL" rel="bookmark">[+]</a></span>]]></description>
				<content:encoded><![CDATA[<p>If you have been doing the other tutorials on this site you will notice that I have been teaching PHP and mySQL through projects. Projects that you can slot into your website, or if you are building a project, code that you can use within your project. I start from the ground up, assuming you have no prior knowledge of the topic. So today, we will be building a Poll System using PHP and mySQL. Polls are great for getting user feedback from your site visitors.</p>
<p align="center"><img src="/wp-content/uploads/2008/04/poll2.jpg" alt="" /></p>
<p align="center"><img src="http://www.jotlab.com/wp-content/uploads/2008/04/poll.jpg" alt="" /></p>
<p>The poll system we will be using today will read and store from a mySQL database. mySQL is an extremely fast, efficient and stable database tool. Our poll system will read the questions stored in the database, then display the options to the users, then when a user selects an option and clicks submit, that selection will be stored in the database whereby results will be further calculated from this pool of results. The tutorial today will teach you PHP, not the database construction side of things. If you are interested in the mySQL side of it, just load up phpmyadmin and look at the database design I have made for the tutorial. I will however provide you with the database design which you can just import, which I will describe how to do. Anyway, lets get started.</p>
<p>But first of all check out my site if you&#8217;re interested in custom decals! Designed by you made by us! <a href="https://www.wedecal.com/step1">www.wedecal.com</a>!</p>
<p>Source: <a title="poll.zip" href="http://www.jotlab.com/wp-content/uploads/2008/04/poll.zip">poll.zip</a><br />
Demo: <a href="http://www.jotlab.com/tutorials/poll/index.php">http://www.jotlab.com/tutorials/poll/index.php</a><br />
<span id="more-1018"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jotlab.com/2008/tutorial-how-to-build-a-poll-system-in-php-and-mysql/feed</wfw:commentRss>
		<slash:comments>78</slash:comments>
		</item>
	</channel>
</rss>
