<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/&quot;C0EESHs5eip7ImA9WhRRFks.&quot;"><id>tag:blogger.com,1999:blog-5290168588330019105</id><updated>2011-11-30T06:00:09.522-08:00</updated><category term="firefox" /><category term="youtube" /><category term="javascript" /><category term="tutorials" /><category term="php" /><category term="photoshop" /><category term="chrome" /><title>NeverEverBlog</title><subtitle type="html">Web design and programming tutorials</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://nevereverblog.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://nevereverblog.blogspot.com/" /><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Nevereverblog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="nevereverblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;C0EESHs4fSp7ImA9WhRRFks.&quot;"><id>tag:blogger.com,1999:blog-5290168588330019105.post-1243213612732795622</id><published>2009-10-27T01:42:00.000-07:00</published><updated>2011-11-30T06:00:09.535-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-30T06:00:09.535-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="firefox" /><category scheme="http://www.blogger.com/atom/ns#" term="chrome" /><category scheme="http://www.blogger.com/atom/ns#" term="youtube" /><title>YouTube Subscriptions fix bookmarklet</title><content type="html">&lt;span style="font-weight:bold;"&gt;UPDATE: &lt;/span&gt;Apparently the problem is no longer relevant.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CfrNLzj-9y0/SubC18nMzoI/AAAAAAAAAE0/vyiyoPCL73A/s1600-h/convert.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 99px;" src="http://4.bp.blogspot.com/_CfrNLzj-9y0/SubC18nMzoI/AAAAAAAAAE0/vyiyoPCL73A/s400/convert.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5397215435509517954" /&gt;&lt;/a&gt;Some time ago YouTube changed the links on &lt;a href="http://www.youtube.com/my_subscriptions"&gt;http://www.youtube.com/my_subscriptions&lt;/a&gt; so that they would open in the same window even if you click it with the third button/wheel. As much as I tolerate other YouTube changes since Google acquired it, this is beyond me. Thus here is my modified version of the AdBlock+ bookmarklet that reverts the links to the way they were.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;b&gt;Drag and drop one of these links to your bookmark toolbar:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="javascript:(function(){function R(w){try{var d=w.document,i,T,N,r=1,s; T=d.getElementsByTagName('a');for(i=T.length-1;(i+1)&amp;&amp;(N=T[i]);--i)if(N.className=='title'||N.className=='video-thumb-120 no-quicklist'){N.href=N.onclick.toString().slice(42,62);N.onclick='';}}catch(E){r=0}return r }R(self);})()"&gt;YTSF 0.2&lt;/a&gt; - Chrome version (tested in Chrome 3.0.195.38)&lt;br /&gt;&lt;a href="javascript:(function(){function%20R(w){try{var%20d=w.document,i,T,N,r=1,s;T=d.getElementsByTagName('a');for(i=T.length-1;(i+1)&amp;&amp;(N=T[i]);--i)if(N.className=='title'||N.className=='video-thumb-120 no-quicklist'){N.href=N.onclick.toString().slice(45,64);N.onclick='';}}catch(E){r=0}return%20r}R(self);})()"&gt;YTSF 0.2&lt;/a&gt; - Firefox version (tested in Firefox 3.5.3)&lt;br /&gt;&lt;br /&gt;The code:&lt;pre&gt;&lt;br /&gt;javascript&lt;span style="font-size:+1;color:BLUE;"&gt;:&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:RED;"&gt;&lt;b&gt;function&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;br /&gt; &lt;span style="color:RED;"&gt;&lt;b&gt;function&lt;/b&gt;&lt;/span&gt; R&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;w&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;   try&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color:RED;"&gt;&lt;b&gt;var&lt;/b&gt;&lt;/span&gt; d&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;w&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;document&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;,&lt;/b&gt;&lt;/span&gt;i&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;,&lt;/b&gt;&lt;/span&gt;T&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;,&lt;/b&gt;&lt;/span&gt;N&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;,&lt;/b&gt;&lt;/span&gt;r&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;&lt;span style="color:BROWN;"&gt;1&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;,&lt;/b&gt;&lt;/span&gt;s&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;       T&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;d&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;getElementsByTagName&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;span style="color:PURPLE;"&gt;"a"&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style="color:RED;"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;i&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;T&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;length&lt;span style="font-size:+1;color:BLUE;"&gt;-&lt;/span&gt;&lt;span style="color:BROWN;"&gt;1&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;i&lt;span style="font-size:+1;color:BLUE;"&gt;+&lt;/span&gt;&lt;span style="color:BROWN;"&gt;1&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;N&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;T&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;[&lt;/b&gt;&lt;/span&gt;i&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;]&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;-&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;-&lt;/span&gt;&lt;/span&gt;i&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;           &lt;span style="color:RED;"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;N&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;className&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;&lt;span style="color:PURPLE;"&gt;"title"&lt;/span&gt; &lt;span style="font-size:+1;color:BLUE;"&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;|&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;|&lt;/span&gt;&lt;/span&gt; N&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;className&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;&lt;span style="color:PURPLE;"&gt;"video-thumb-120 no-quicklist"&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;br /&gt; N&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;href&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;N&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;onclick&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;toString&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;slice&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;span style="color:BROWN;"&gt;42&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;,&lt;/b&gt;&lt;/span&gt;62&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt; N&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;onclick&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;&lt;span style="color:PURPLE;"&gt;''&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt; &lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;     catch&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;E&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;r&lt;span style="font-size:+1;color:BLUE;"&gt;=&lt;/span&gt;&lt;span style="color:BROWN;"&gt;0&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color:RED;"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/span&gt; r&lt;br /&gt;   &lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt; R&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;self&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:+1;color:BLUE;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The original AdBlock+ code can be found &lt;a href="http://www.googlechromeplugins.com/plugins-talk/block-for-google-chrome-out-t173.html"&gt;here&lt;/a&gt; or &lt;a href="http://blogote.com/2008/featured-article/google-chrome-with-firefox-addon.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5290168588330019105-1243213612732795622?l=nevereverblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://nevereverblog.blogspot.com/feeds/1243213612732795622/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nevereverblog.blogspot.com/2009/10/youtube-subscriptions-fix-bookmarklet.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5290168588330019105/posts/default/1243213612732795622?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5290168588330019105/posts/default/1243213612732795622?v=2" /><link rel="alternate" type="text/html" href="http://nevereverblog.blogspot.com/2009/10/youtube-subscriptions-fix-bookmarklet.html" title="YouTube Subscriptions fix bookmarklet" /><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_CfrNLzj-9y0/SubC18nMzoI/AAAAAAAAAE0/vyiyoPCL73A/s72-c/convert.png" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;Dk8BSHw8eSp7ImA9WxVbEUU.&quot;"><id>tag:blogger.com,1999:blog-5290168588330019105.post-3309548320448693266</id><published>2009-03-21T12:36:00.000-07:00</published><updated>2009-03-27T13:14:19.271-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-27T13:14:19.271-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tutorials" /><category scheme="http://www.blogger.com/atom/ns#" term="photoshop" /><title>Make your own Photoshop patterns</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CfrNLzj-9y0/ScVMmoe6lTI/AAAAAAAAADw/gCUB_18Feqc/s1600-h/patterns.jpg"&gt;&lt;img style="float:right;cursor:pointer; cursor:hand;width: 130px; height: 130px;" src="http://4.bp.blogspot.com/_CfrNLzj-9y0/ScVMmoe6lTI/AAAAAAAAADw/gCUB_18Feqc/s320/patterns.jpg" border="0" alt="Photoshop patterns" id="BLOGGER_PHOTO_ID_5315739161766565170" /&gt;&lt;/a&gt;You can find patterns on many websites.&lt;br /&gt;Designers often use them spice up their layouts.&lt;br /&gt;In this tutorial I will show you how to make your own patterns for your websites in Photoshop.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;Create a new transparent document in photoshop, the width and height varies from pattern to pattern. I specified the sizes for patterns below next to their names.&lt;br /&gt;&lt;br /&gt;Next zoom in to the max("Alt" + "Scroll Wheel" or "Ctrl" + "=") and select the pencil tool).&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScXnklYRb5I/AAAAAAAAAD4/_NncM1GFuwg/s1600-h/pencil.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 228px; height: 65px;" src="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScXnklYRb5I/AAAAAAAAAD4/_NncM1GFuwg/s320/pencil.jpg" border="0" alt="Photoshop pencil tool" id="BLOGGER_PHOTO_ID_5315909550875963282" /&gt;&lt;/a&gt;&lt;br /&gt;All that's left is to reproduce the pixels of your desired pattern.&lt;br /&gt;&lt;br /&gt;Once you're done, go to Edit-&gt;Define Pattern...&lt;br /&gt;Name your pattern and it's done.&lt;br /&gt;&lt;br /&gt;To test the new pattern you can use the "Paint Bucket Tool"&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScXrUKrFz8I/AAAAAAAAAEA/bkby_2RDBvo/s1600-h/paint-bucket.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 198px; height: 46px;" src="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScXrUKrFz8I/AAAAAAAAAEA/bkby_2RDBvo/s320/paint-bucket.jpg" border="0" alt="paint bucket tool" id="BLOGGER_PHOTO_ID_5315913666875740098" /&gt;&lt;/a&gt;&lt;br /&gt;Don't forget to select "Pattern" instead of "Foreground" in the tool options.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CfrNLzj-9y0/ScXtvJHGbNI/AAAAAAAAAEY/jGfhyPUhpi8/s1600-h/pattern.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 194px; height: 64px;" src="http://2.bp.blogspot.com/_CfrNLzj-9y0/ScXtvJHGbNI/AAAAAAAAAEY/jGfhyPUhpi8/s320/pattern.jpg" border="0" alt="paint bucket tool options" id="BLOGGER_PHOTO_ID_5315916329336073426" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Or right click on a layer, click "Blending Options".&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CfrNLzj-9y0/ScXs8sLk01I/AAAAAAAAAEQ/G6zEiiniZP8/s1600-h/blending-options.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 200px; height: 102px;" src="http://2.bp.blogspot.com/_CfrNLzj-9y0/ScXs8sLk01I/AAAAAAAAAEQ/G6zEiiniZP8/s200/blending-options.jpg" border="0" alt="Blending options" id="BLOGGER_PHOTO_ID_5315915462576755538" /&gt;&lt;/a&gt;&lt;br /&gt;Then go to "Pattern Overlay" and select the pattern you want to try out.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScXr_mcT5vI/AAAAAAAAAEI/Xtq8VnECJZM/s1600-h/pattern-overlay.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 200px; height: 148px;" src="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScXr_mcT5vI/AAAAAAAAAEI/Xtq8VnECJZM/s200/pattern-overlay.jpg" border="0" alt="Pattern overlay" id="BLOGGER_PHOTO_ID_5315914413064316658" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Pictures to the left are the patterns zoomed in, while pictures to the right are the previews of the way the pattern actually look.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Diagonal lines A (3x3 pixels)&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CfrNLzj-9y0/ScVCnLdkt1I/AAAAAAAAABg/NjCCCi1vxZA/s1600-h/pattern1.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 96px; height: 96px;" src="http://4.bp.blogspot.com/_CfrNLzj-9y0/ScVCnLdkt1I/AAAAAAAAABg/NjCCCi1vxZA/s320/pattern1.jpg" border="0" alt="Diagonal line pattern" id="BLOGGER_PHOTO_ID_5315728176039901010" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVCw0u0R8I/AAAAAAAAABo/RzjOA9kJZ7Y/s1600-h/pattern1-preview.jpg"&gt;&lt;img style=" margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 96px; height: 96px;" src="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVCw0u0R8I/AAAAAAAAABo/RzjOA9kJZ7Y/s320/pattern1-preview.jpg" border="0" alt="Diagonal line pattern preview" id="BLOGGER_PHOTO_ID_5315728341736900546" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Diagonal lines B (3x3 pixels)&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScVDYVwcMQI/AAAAAAAAABw/GddMRwU5ps8/s1600-h/pattern1a.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 96px; height: 96px;" src="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScVDYVwcMQI/AAAAAAAAABw/GddMRwU5ps8/s320/pattern1a.jpg" border="0" alt="Diagonal line pattern" id="BLOGGER_PHOTO_ID_5315729020616978690" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CfrNLzj-9y0/ScVDYsAAOwI/AAAAAAAAAB4/-AgB0ZMgT6M/s1600-h/pattern1a-preview.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 96px; height: 96px;" src="http://2.bp.blogspot.com/_CfrNLzj-9y0/ScVDYsAAOwI/AAAAAAAAAB4/-AgB0ZMgT6M/s320/pattern1a-preview.jpg" border="0" alt="Diagonal line pattern preview" id="BLOGGER_PHOTO_ID_5315729026587835138" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Thick diagonal lines (9x9 pixels)&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CfrNLzj-9y0/ScVD6r7EYjI/AAAAAAAAACA/fTT06WppwKY/s1600-h/pattern2.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 92px; height: 92px;" src="http://2.bp.blogspot.com/_CfrNLzj-9y0/ScVD6r7EYjI/AAAAAAAAACA/fTT06WppwKY/s320/pattern2.jpg" border="0" alt="Diagonal line pattern" id="BLOGGER_PHOTO_ID_5315729610682688050" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVD6sLhEMI/AAAAAAAAACI/nPN-sKZDvHo/s1600-h/pattern2-preivew.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 92px; height: 92px;" src="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVD6sLhEMI/AAAAAAAAACI/nPN-sKZDvHo/s320/pattern2-preivew.jpg" border="0" alt="Diagonal line pattern preview" id="BLOGGER_PHOTO_ID_5315729610751676610" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Vertical lines (2x1 pixels)&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScVEdi1n8HI/AAAAAAAAACg/PCZz1M0qg9s/s1600-h/pattern3.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 64px; height: 32px;" src="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScVEdi1n8HI/AAAAAAAAACg/PCZz1M0qg9s/s320/pattern3.jpg" border="0" alt="Vertical line pattern" id="BLOGGER_PHOTO_ID_5315730209539354738" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVEd0YUZGI/AAAAAAAAACo/ySdM7nYbs0U/s1600-h/pattern3-preview.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 64px; height: 64px;" src="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVEd0YUZGI/AAAAAAAAACo/ySdM7nYbs0U/s320/pattern3-preview.jpg" border="0" alt="Vertical line pattern preview" id="BLOGGER_PHOTO_ID_5315730214248277090" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Horizontal lines "Scanlines" (1x2 pixels)&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_CfrNLzj-9y0/ScVEuBqUa0I/AAAAAAAAACw/hNW_j71Etno/s1600-h/pattern3a.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 32px; height: 64px;" src="http://4.bp.blogspot.com/_CfrNLzj-9y0/ScVEuBqUa0I/AAAAAAAAACw/hNW_j71Etno/s320/pattern3a.jpg" border="0" alt="Horizontal line pattern" id="BLOGGER_PHOTO_ID_5315730492691344194" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVEuPifpBI/AAAAAAAAAC4/bRF1VTrzfWY/s1600-h/pattern3a-preview.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 64px; height: 64px;" src="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVEuPifpBI/AAAAAAAAAC4/bRF1VTrzfWY/s320/pattern3a-preview.jpg" border="0" alt="Horizontal line pattern preview" id="BLOGGER_PHOTO_ID_5315730496416621586" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Holes (10x10 pixels)&lt;/span&gt;&lt;br /&gt;These look nice on a colorfull background with the "soft light" blending mode.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScVFDTaE17I/AAAAAAAAADA/KjyBn7o2neQ/s1600-h/pattern4.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 130px; height: 130px;" src="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScVFDTaE17I/AAAAAAAAADA/KjyBn7o2neQ/s320/pattern4.jpg" border="0" alt="Hole pattern" id="BLOGGER_PHOTO_ID_5315730858232305586" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_CfrNLzj-9y0/ScXwFl4kQsI/AAAAAAAAAEg/0-BTOXiyiBA/s1600-h/pattern4-preview.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 130px; height: 130px;" src="http://2.bp.blogspot.com/_CfrNLzj-9y0/ScXwFl4kQsI/AAAAAAAAAEg/0-BTOXiyiBA/s320/pattern4-preview.jpg" border="0" alt="Hole pattern preview" id="BLOGGER_PHOTO_ID_5315918914040120002" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Cells (10x10 pixels)&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScVFaopH7aI/AAAAAAAAADQ/Nyk_GqZmMIk/s1600-h/pattern5.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 126px; height: 126px;" src="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScVFaopH7aI/AAAAAAAAADQ/Nyk_GqZmMIk/s320/pattern5.jpg" border="0" alt="Cell pattern" id="BLOGGER_PHOTO_ID_5315731259069558178" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScVFanGnHFI/AAAAAAAAADY/csMcTX7uHA4/s1600-h/pattern5-preview.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 126px; height: 126px;" src="http://1.bp.blogspot.com/_CfrNLzj-9y0/ScVFanGnHFI/AAAAAAAAADY/csMcTX7uHA4/s320/pattern5-preview.jpg" border="0" alt="Cell pattern preview" id="BLOGGER_PHOTO_ID_5315731258656365650" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Carbon Fiber (4x4 pixels)&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVFrpYVffI/AAAAAAAAADo/4lJ1WdlXwBk/s1600-h/pattern6-carbon-fibre.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVFrpYVffI/AAAAAAAAADo/4lJ1WdlXwBk/s320/pattern6-carbon-fibre.jpg" border="0" alt="Carbon Fiber Photoshop pattern" id="BLOGGER_PHOTO_ID_5315731551325355506" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVFrrQ54aI/AAAAAAAAADg/IqqwY1iVfIg/s1600-h/pattern6-carbon-fibre-preview.jpg"&gt;&lt;img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 128px; height: 128px;" src="http://3.bp.blogspot.com/_CfrNLzj-9y0/ScVFrrQ54aI/AAAAAAAAADg/IqqwY1iVfIg/s320/pattern6-carbon-fibre-preview.jpg" border="0" alt="Carbon Fiber Photoshop pattern preview" id="BLOGGER_PHOTO_ID_5315731551831056802" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;TIP: &lt;/span&gt;Try experimenting by using different blending modes and styles on your pattern to make them look even better.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5290168588330019105-3309548320448693266?l=nevereverblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://nevereverblog.blogspot.com/feeds/3309548320448693266/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nevereverblog.blogspot.com/2009/03/make-your-own-photoshop-patterns.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5290168588330019105/posts/default/3309548320448693266?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5290168588330019105/posts/default/3309548320448693266?v=2" /><link rel="alternate" type="text/html" href="http://nevereverblog.blogspot.com/2009/03/make-your-own-photoshop-patterns.html" title="Make your own Photoshop patterns" /><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_CfrNLzj-9y0/ScVMmoe6lTI/AAAAAAAAADw/gCUB_18Feqc/s72-c/patterns.jpg" height="72" width="72" /><thr:total>2</thr:total></entry><entry gd:etag="W/&quot;DUYHRH85eCp7ImA9WxVaF08.&quot;"><id>tag:blogger.com,1999:blog-5290168588330019105.post-7080903720087971062</id><published>2009-03-19T00:13:00.000-07:00</published><updated>2009-04-14T09:38:55.120-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-14T09:38:55.120-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tutorials" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><title>Simple PHP website tutorial</title><content type="html">If you ever tried making a simple website with only a handful of pages, you probably noticed that once you need to edit some menu element, you have to edit all of your pages, which can be very irritating.&lt;br /&gt;The simplest way to solve this problem without resorting to coding is using &lt;a href="http://www.w3schools.com/HTML/html_frames.asp"&gt;frames&lt;/a&gt;. I encourage you not to do that. You can see &lt;a href="http://www.useit.com/alertbox/9612.html"&gt;for&lt;/a&gt; &lt;a href="http://www.boutell.com/newfaq/creating/framesbad.html"&gt;your&lt;/a&gt; &lt;a href="http://www.hobo-web.co.uk/tips/41.htm"&gt;self&lt;/a&gt; &lt;a href="http://websitetips.com/articles/html/frames/"&gt;why&lt;/a&gt;.&lt;br /&gt;Instead you can apply one of the following PHP techniques.&lt;br /&gt;&lt;span class="fullpost"&gt;&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight:bold;color: rgb(204, 102, 0);"&gt;1) The content include method&lt;/span&gt;&lt;br /&gt;In this method you put the unique content of your pages in different files like "&lt;span style="font-weight:bold;"&gt;news.html&lt;/span&gt;", "&lt;span style="font-weight:bold;"&gt;about.html&lt;/span&gt;" etc. While the HTML that is the same for all the pages, like the menu, stays in &lt;span style="font-weight:bold;"&gt;index.php&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;To make this work you need to put the code that will load the contents of your pages into index.php. In PHP the &lt;span style="color:#007700;"&gt; include()&lt;/span&gt; function is just what we need to do the job. Alternatively you can use &lt;span style="color:#007700;"&gt; require()&lt;/span&gt;, it won't make &lt;a href="http://nevereverblog.blogspot.com/2009/03/include-require-includeonce-requireonce.html"&gt;a big difference&lt;/a&gt;.&lt;br /&gt;Next, through our hyper links, we need to tell that function which file it should load into our main page. We need a variable for that, in this example I will call our variable "page" for the sake of simplicity. Which means that our links would look something like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="color:#0000CC;"&gt;&amp;lt;a href="index.php"&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;a href="index.php?page=page1"&amp;gt;Page1&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;a href="index.php?page=page2"&amp;gt;Page2&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;a href="index.php?page=page3"&amp;gt;Page3&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now we can work with the &lt;span style="color:#007700;"&gt; include()&lt;/span&gt; function.&lt;br /&gt;As you probably noticed form our links above, the first link called "Home" doesn't assign any parameters to the "page" variable. To make &lt;span style="color:#007700;"&gt; include()&lt;/span&gt; work and protect our website form the &lt;a href="http://en.wikipedia.org/wiki/Cross-site_scripting"&gt;Cross-site scripting vulnerability&lt;/a&gt; at the same time we will use a &lt;span style="color:#007700;"&gt; switch()&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="color:#007700;"&gt;switch(&lt;/span&gt;&lt;span style="color:#0000BB;"&gt;$_GET&lt;/span&gt;&lt;span style="color:#007700;"&gt;[&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page'&lt;/span&gt;&lt;span style="color:#007700;"&gt;]) {&lt;br /&gt;    case &lt;/span&gt;&lt;span style="color:#DD0000;"&gt;"page1"&lt;/span&gt;&lt;span style="color:#007700;"&gt;: include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page1_content.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;); break;&lt;br /&gt;    case &lt;/span&gt;&lt;span style="color:#DD0000;"&gt;"page2"&lt;/span&gt;&lt;span style="color:#007700;"&gt;: include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page2_content.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;); break;&lt;br /&gt;    case &lt;/span&gt;&lt;span style="color:#DD0000;"&gt;"page3"&lt;/span&gt;&lt;span style="color:#007700;"&gt;: include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page3_content.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;); break;&lt;br /&gt;    default: include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'home.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;Since I chose to call the variable "page" the switch looks this way: "&lt;code&gt;&lt;span style="color:#007700;"&gt;switch(&lt;/span&gt;&lt;span style="color:#0000BB;"&gt;$_GET&lt;/span&gt;&lt;span style="color:#007700;"&gt;[&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page'&lt;/span&gt;&lt;span style="color:#007700;"&gt;])&lt;/span&gt; {&lt;/code&gt;" and the next four lines decide which file should be loaded depending on the value of the variable. So the line &lt;code&gt;&lt;span style="color:#0000CC;"&gt;case &lt;/span&gt;&lt;span style="color:#DD0000;"&gt;"page1"&lt;/span&gt;&lt;span style="color:#007700;"&gt;: include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page1_content.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;); break;&lt;/span&gt;&lt;/code&gt; means: if the variable was set to 'page1' then load page 'page1_content.html'.&lt;br /&gt;But the last line: &lt;code&gt;&lt;span style="color:#0000CC;"&gt;default: include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'home.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;);&lt;/span&gt;&lt;/code&gt; means: if the variable "page" is set to anything else then home.html will be loaded.&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="fullpost"&gt;One more thing: we have to make sure that the variable &lt;span class="Apple-style-span"  style=" ;font-family:-webkit-monospace;"&gt;&lt;span style="color:#0000BB;"&gt;&lt;span class="Apple-style-span"  style=" ;font-size:13px;"&gt;$_GET&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#007700;"&gt;&lt;span class="Apple-style-span"  style=" ;font-size:13px;"&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;&lt;span class="Apple-style-span"  style=" ;font-size:13px;"&gt;'page'&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#007700;"&gt;&lt;span class="Apple-style-span"  style=" ;font-size:13px;"&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; is set, else PHP will output an error. Therefore we will add this line before the &lt;span class="Apple-style-span" style="color: rgb(0, 153, 0);"&gt;switch()&lt;/span&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="fullpost"&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'times new roman';"&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;&lt;span style="color:#007700;"&gt;if(!isset(&lt;/span&gt;&lt;span style="color:#0000BB;"&gt;$_GET&lt;/span&gt;&lt;span style="color:#007700;"&gt;[&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page'&lt;/span&gt;&lt;span style="color:#007700;"&gt;])) &lt;/span&gt;&lt;span style="color:#0000BB;"&gt;$_GET&lt;/span&gt;&lt;span style="color:#007700;"&gt;[&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page'&lt;/span&gt;&lt;span style="color:#007700;"&gt;]=&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;""&lt;/span&gt;&lt;span style="color:#007700;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;This line will define the variable &lt;span class="Apple-style-span"  style="  ;font-family:-webkit-monospace;"&gt;&lt;span style="color:#0000BB;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;$_GET&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#007700;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;'page'&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#007700;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; in case it hasnt already been defined.&lt;br /&gt;(Thanks to Arthur for reminding me)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now if we put it all together we will get something similar to this:&lt;code&gt;&lt;span style="color:#0000CC;"&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;My Website&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;a href="index.php"&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;a href="index.php?page=page1"&amp;gt;Page1&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;a href="index.php?page=page1"&amp;gt;Page2&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;a href="index.php?page=page1"&amp;gt;Page3&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#0000BB;"&gt;&amp;lt;?php&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="color:#0000CC;"&gt;&lt;span style="color:#0000BB;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); "&gt;&lt;span style="color:#007700;"&gt;if(!isset(&lt;/span&gt;&lt;span style="color:#0000BB;"&gt;$_GET&lt;/span&gt;&lt;span style="color:#007700;"&gt;[&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page'&lt;/span&gt;&lt;span style="color:#007700;"&gt;])) &lt;/span&gt;&lt;span style="color:#0000BB;"&gt;$_GET&lt;/span&gt;&lt;span style="color:#007700;"&gt;[&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page'&lt;/span&gt;&lt;span style="color:#007700;"&gt;]=&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;""&lt;/span&gt;&lt;span style="color:#007700;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#007700;"&gt;switch(&lt;/span&gt;&lt;span style="color:#0000BB;"&gt;$_GET&lt;/span&gt;&lt;span style="color:#007700;"&gt;[&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page'&lt;/span&gt;&lt;span style="color:#007700;"&gt;]) {&lt;br /&gt;    case &lt;/span&gt;&lt;span style="color:#DD0000;"&gt;"page1"&lt;/span&gt;&lt;span style="color:#007700;"&gt;: include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page1_content.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;); break;&lt;br /&gt;    case &lt;/span&gt;&lt;span style="color:#DD0000;"&gt;"page2"&lt;/span&gt;&lt;span style="color:#007700;"&gt;: include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page2_content.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;); break;&lt;br /&gt;    case &lt;/span&gt;&lt;span style="color:#DD0000;"&gt;"page3"&lt;/span&gt;&lt;span style="color:#007700;"&gt;: include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'page3_content.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;); break;&lt;br /&gt;    default: include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'home.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#0000BB;"&gt;?&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/span&gt; &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;One of the disadvantages of this method is that all of your pages will have the same title, unless you're willing to write a little bit more code.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight:bold;color: rgb(204, 102, 0);"&gt;2) The menu include method&lt;/span&gt;&lt;br /&gt;In this method you have your menu in a separate file like '&lt;span style="font-weight:bold;"&gt;menu.html&lt;/span&gt;', which you include on all of your html pages like "index.php", "about.php" etc.  using this code:&lt;br /&gt;&lt;code&gt;&lt;span style="color:#0000BB;"&gt;&amp;lt;?php&lt;br /&gt;&lt;span style="color:#007700;"&gt;include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'menu.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;);&lt;/span&gt;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;So our typical page would look like this:&lt;br /&gt;&lt;code&gt;&lt;span style="color:#0000CC;"&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;My Website&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;span style="color:#007700;"&gt;include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'menu.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;);&lt;/span&gt;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;h1&amp;gt; Hello and welcome to my website&amp;lt;/h1&amp;gt;&lt;br /&gt;The content of the page goes here.&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/span&gt; &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This way you can easily have different titles on different pages and easily change your menu on all the pages by editing one file.&lt;br /&gt;&lt;br /&gt;In case you have something on the bottom of the page like "All rights reserved" or "This website is a registered trademark..." which is the same on all the pages you can put it in separate file like "footer.html" and include it with the code:&lt;br /&gt;&lt;code&gt;&lt;span style="color:#0000BB;"&gt;&amp;lt;?php&lt;br /&gt;&lt;span style="color:#007700;"&gt;include(&lt;/span&gt;&lt;span style="color:#DD0000;"&gt;'footer.html'&lt;/span&gt;&lt;span style="color:#007700;"&gt;);&lt;/span&gt;&lt;br /&gt;?&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5290168588330019105-7080903720087971062?l=nevereverblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://nevereverblog.blogspot.com/feeds/7080903720087971062/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nevereverblog.blogspot.com/2009/03/simple-php-website-tutorial.html#comment-form" title="13 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5290168588330019105/posts/default/7080903720087971062?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5290168588330019105/posts/default/7080903720087971062?v=2" /><link rel="alternate" type="text/html" href="http://nevereverblog.blogspot.com/2009/03/simple-php-website-tutorial.html" title="Simple PHP website tutorial" /><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>13</thr:total></entry><entry gd:etag="W/&quot;D0QESXo9fCp7ImA9WxVbEUU.&quot;"><id>tag:blogger.com,1999:blog-5290168588330019105.post-6378543476157971222</id><published>2009-03-17T10:48:00.000-07:00</published><updated>2009-03-27T13:21:48.464-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-27T13:21:48.464-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="php" /><title>include, require, include_once, require_once</title><content type="html">When it comes to dividing and ruling your code, PHP has a confusing amount of standard functions to do the job. Take &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;include()&lt;/span&gt; for example. It works fine so why make the other copycats? &lt;span class="fullpost"&gt;To figure that one out there's no better place to go to than the &lt;a href="http://www.php.net/"&gt;PHP.net&lt;/a&gt;. Once there search for the next big thing after include() - &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;require()&lt;/span&gt;. And there you have it,&lt;span class="Apple-style-span" style="color: rgb(51, 102, 255);"&gt; the difference between include() and require() is the way the two handle their inability to load the specified file&lt;/span&gt;. Upon failing include() would only output a warning, whereas require() would result in a fatal error. &lt;div&gt;Therefore, if it is crucial to execute a certain script - &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;require() &lt;/span&gt;it, on the other hand if you can do without that script if PHP will fail to load it - &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;include()&lt;/span&gt; it.&lt;div&gt;&lt;br /&gt;&lt;div&gt;That being said we can move on to &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;incude_once()&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;require_once()&lt;/span&gt; functions. The sole purpose of adding _once to require and include is to make sure they won't accidently repeat themselves. And in case the PHP interpreter will run in, let's say, require_once('myfile.php') two, three or more times it will simply ignore them, executing the script myfile.php only once. This can be very usefull when your code becomes too big and complex and you don't want PHP to go through the same scripts several times.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There's also the performance issue. When running _once() functions PHP has to check whether the file has already been included or not, but that only becomes an issue when you have hundreds of those.  So if you're interested you can find some controversial benchmark results by Googling something like &lt;a href="http://www.google.com/search?q=php+include+require+benchmark"&gt;php include require benchmark&lt;/a&gt; or &lt;a href="http://www.google.com/search?q=include+vs+require+vs+include_once+vs+require+once"&gt;include vs require vs include_once vs require once&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5290168588330019105-6378543476157971222?l=nevereverblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://nevereverblog.blogspot.com/feeds/6378543476157971222/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nevereverblog.blogspot.com/2009/03/include-require-includeonce-requireonce.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5290168588330019105/posts/default/6378543476157971222?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5290168588330019105/posts/default/6378543476157971222?v=2" /><link rel="alternate" type="text/html" href="http://nevereverblog.blogspot.com/2009/03/include-require-includeonce-requireonce.html" title="include, require, include_once, require_once" /><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;A0YAQnc-eyp7ImA9WxVUF00.&quot;"><id>tag:blogger.com,1999:blog-5290168588330019105.post-1251017797513078998</id><published>2009-03-17T10:16:00.001-07:00</published><updated>2009-03-22T01:05:43.953-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-22T01:05:43.953-07:00</app:edited><title>NeverEverPost #1</title><content type="html">Hello world&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5290168588330019105-1251017797513078998?l=nevereverblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://nevereverblog.blogspot.com/feeds/1251017797513078998/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nevereverblog.blogspot.com/2009/03/never-ever-post-1.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5290168588330019105/posts/default/1251017797513078998?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5290168588330019105/posts/default/1251017797513078998?v=2" /><link rel="alternate" type="text/html" href="http://nevereverblog.blogspot.com/2009/03/never-ever-post-1.html" title="NeverEverPost #1" /><author><name>Alex</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total></entry></feed>

