<?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"
	>

<channel>
	<title>PHP Scripts</title>
	<atom:link href="http://www.php-script.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.php-script.co.uk</link>
	<description>PHP Scripts and Internet news</description>
	<pubDate>Mon, 13 Jul 2009 23:02:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Tivoli Storage Manager - Tape Libray Usage</title>
		<link>http://www.php-script.co.uk/2009/07/tivoli-storage-manager-tape-libray-usage/</link>
		<comments>http://www.php-script.co.uk/2009/07/tivoli-storage-manager-tape-libray-usage/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 23:01:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Tivoli Storage Manager]]></category>

		<guid isPermaLink="false">http://www.php-script.co.uk/?p=22</guid>
		<description><![CDATA[Hi, 
We do a lot of work work with Tivoli Storage Manager and a lot of our smaller customers have storage pools that will not fit into their tape library. We know this is totally wrong but is life and it happens. 
Heres a small script we thought we would share, it has helped us [...]]]></description>
			<content:encoded><![CDATA[<p>Hi, </p>
<p>We do a lot of work work with Tivoli Storage Manager and a lot of our smaller customers have storage pools that will not fit into their tape library. We know this is totally wrong but is life and it happens. </p>
<p>Heres a small script we thought we would share, it has helped us loads over the past years; it displays the current tape libray usage so you can make an informed choice on the tapes to remove or reclaim.</p>
<p>def script q_li_usage &#8220;select volume_name,stgpool_name,pct_utilized,status from volumes where volume_name in (select volume_name from libvolumes)&#8221;</p>
<p>TSM Support</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-script.co.uk/2009/07/tivoli-storage-manager-tape-libray-usage/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Application Access Levels with PHP</title>
		<link>http://www.php-script.co.uk/2009/02/application-access-levels-with-php/</link>
		<comments>http://www.php-script.co.uk/2009/02/application-access-levels-with-php/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 22:07:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP Scripts]]></category>

		<guid isPermaLink="false">http://www.php-script.co.uk/?p=20</guid>
		<description><![CDATA[Hello all
This week we got a job in to write an intranet site for a large Insurance company in the UK.
It had 60 or so applications that needed writing with access to each being given on a per user basis.
So for example user “A” could see applications 1 and 3, and user B could only [...]]]></description>
			<content:encoded><![CDATA[<p>Hello all</p>
<p>This week we got a job in to write an intranet site for a large Insurance company in the UK.</p>
<p>It had 60 or so applications that needed writing with access to each being given on a per user basis.</p>
<p>So for example user “A” could see applications 1 and 3, and user B could only use application 2.</p>
<p>So how do you do this easily?</p>
<p>We started off having a link table, it had User ‘A’ mapped to application 1 and so on. Which is ok but they have 5000+ staff and 60 applications so that would be a table with 300,000 rows in it, which in its self in MySql is nothing really, it just seemed excessive.</p>
<p>What we came up with is a bitwise solution so each application had a bit assigned to it. So if you remember your binary “0 1 2 4”   etc.  Each application was assigned a binary number, so application 1 was “1” in binary, application 2 was “10” ,application 3 was “100” and so on</p>
<p>So if a user as an access level of 7, that would translate in to a binary number of 111 so they could access application 1, 2 and 3. If a user had an access level of 4 for example they could only access application 3.</p>
<table border="0">
<tbody>
<tr>
<td>Binary (Base 2)</td>
<td>Application</td>
</tr>
<tr>
<td>0</td>
<td>Superuser</td>
</tr>
<tr>
<td>1</td>
<td>Application 1</td>
</tr>
<tr>
<td>2</td>
<td>Application 2</td>
</tr>
<tr>
<td>4</td>
<td>Application 3</td>
</tr>
<tr>
<td>8</td>
<td>Application 4</td>
</tr>
</tbody>
</table>
<p>We will post the class over the next few weeks if any body else wants to use it.</p>
<p>Happy coding</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-script.co.uk/2009/02/application-access-levels-with-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Oracle Databases on Windows</title>
		<link>http://www.php-script.co.uk/2008/10/oracle-databases-on-windows/</link>
		<comments>http://www.php-script.co.uk/2008/10/oracle-databases-on-windows/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 22:02:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Databases]]></category>

		<guid isPermaLink="false">http://www.php-script.co.uk/?p=19</guid>
		<description><![CDATA[We have done a lot of Database work using PHP applications and nine times out of  ten we end up using an MS SQL server backend instead of the standard mySQL backend. MS SQL has so many plus points compared with mySQL, the biggest being speed, recovery, backup and database management.
We have, however, been testing [...]]]></description>
			<content:encoded><![CDATA[<p>We have done a lot of Database work using PHP applications and nine times out of  ten we end up using an MS SQL server backend instead of the standard mySQL backend. MS SQL has so many plus points compared with mySQL, the biggest being speed, recovery, backup and database management.</p>
<p>We have, however, been testing with Oracle in the past month or so. As most of us here come from a DBA background and are used to using  Oracle in large Banking and Financial systems, we would choose Oracle at the drop a  hat if the  TCO  was in the right ball park. With the release of Oracle on windows, it has now come into the same ball park as MS SQL, and having  access to Oracles RAC would be a great advantage as it seems to be even better than MS SQL 2005 mirroring.</p>
<p>We will let you know how our testing gets on and we will hopefully have some benchmarks between MS SQL and Oracle 11g to show how they get on with PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-script.co.uk/2008/10/oracle-databases-on-windows/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Is a date in a given range using PHP</title>
		<link>http://www.php-script.co.uk/2008/07/is-a-date-in-a-given-range/</link>
		<comments>http://www.php-script.co.uk/2008/07/is-a-date-in-a-given-range/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 02:14:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP Scripts]]></category>

		<guid isPermaLink="false">http://www.php-script.co.uk/?p=15</guid>
		<description><![CDATA[To find if a date is in a given data range, the quikest way is to turn all dates to Epoch dates and then do a compare.
So to test if 31/12/2007 is in a date range of 10-10-2000 and 10-10-2008 do the following
$From=&#8221;31-12-2007&#8243;;
$To=&#8221;10-10-2008&#8243;;
$Checkdate=&#8221;01-01-2008&#8243;;
if (
( mktime(0,0,0, date(&#8221;m&#8221;,strtotime($From)),date(&#8221;d&#8221;,strtotime($From)),date(&#8221;Y&#8221;,strtotime($From)))
&#60;=
mktime(0,0,0,date(&#8221;m&#8221;,strtotime($Checkdate)),date(&#8221;d&#8221;,strtotime($Checkdate)),date(&#8221;Y&#8221;,strtotime($Checkdate))) )
&#38;&#38;
(mktime(0,0,0,date(&#8221;m&#8221;,strtotime($To)),date(&#8221;d&#8221;,strtotime($To)),date(&#8221;Y&#8221;,strtotime($To)))
&#62;=
mktime(0,0,0,date(&#8221;m&#8221;,strtotime($Checkdate)),date(&#8221;d&#8221;,strtotime($Checkdate)),date(&#8221;Y&#8221;,strtotime($Checkdate))) ) ) {
print &#8220;In Date Range&#8221;;
} else {
print [...]]]></description>
			<content:encoded><![CDATA[<p>To find if a date is in a given data range, the quikest way is to turn all dates to Epoch dates and then do a compare.</p>
<p>So to test if 31/12/2007 is in a date range of 10-10-2000 and 10-10-2008 do the following</p>
<div style="border: 1px solid #000; width: 500px;font-size: 8px;">$From=&#8221;31-12-2007&#8243;;<br />
$To=&#8221;10-10-2008&#8243;;<br />
$Checkdate=&#8221;01-01-2008&#8243;;</p>
<p>if (<br />
( mktime(0,0,0, date(&#8221;m&#8221;,strtotime($From)),date(&#8221;d&#8221;,strtotime($From)),date(&#8221;Y&#8221;,strtotime($From)))<br />
&lt;=<br />
mktime(0,0,0,date(&#8221;m&#8221;,strtotime($Checkdate)),date(&#8221;d&#8221;,strtotime($Checkdate)),date(&#8221;Y&#8221;,strtotime($Checkdate))) )</p>
<p>&amp;&amp;</p>
<p>(mktime(0,0,0,date(&#8221;m&#8221;,strtotime($To)),date(&#8221;d&#8221;,strtotime($To)),date(&#8221;Y&#8221;,strtotime($To)))<br />
&gt;=<br />
mktime(0,0,0,date(&#8221;m&#8221;,strtotime($Checkdate)),date(&#8221;d&#8221;,strtotime($Checkdate)),date(&#8221;Y&#8221;,strtotime($Checkdate))) ) ) {</p>
<p>print &#8220;In Date Range&#8221;;</p>
<p>} else {</p>
<p>print &#8220;Not in Range&#8221;;<br />
}</p>
</div>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-script.co.uk/2008/07/is-a-date-in-a-given-range/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mamma Mia the Movie</title>
		<link>http://www.php-script.co.uk/2008/07/mamma-mia-the-movie/</link>
		<comments>http://www.php-script.co.uk/2008/07/mamma-mia-the-movie/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 00:46:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Fun Stuff]]></category>

		<guid isPermaLink="false">http://www.php-script.co.uk/?p=14</guid>
		<description><![CDATA[


What can I say, I thoroughly enjoyed the film in its own right as a funny film with actors that keep busting in to song, and to be fair I recognised most of the songs.
The only painful part was Pierce singing, probably because he reminded me of my brother-in-law who sings in pubs in southern [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin: 10px;">
<iframe src="http://rcm-uk.amazon.co.uk/e/cm?t=ourgardeinfor-21&#038;o=2&#038;p=8&#038;l=as1&#038;asins=B001AVSUBO&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<p>What can I say, I thoroughly enjoyed the film in its own right as a funny film with actors that keep busting in to song, and to be fair I recognised most of the songs.</p>
<p>The only painful part was Pierce singing, probably because he reminded me of my brother-in-law who sings in pubs in southern Ireland.</p>
<p>Apart from that, it was a very easy film to watch. So it gets my vote especially if you want to earn some brownie points.</p>
<p>According to MSN this week it has made over £7.5million pounds in the first week at the box offices so it sounds like a few people have be to see it already.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-script.co.uk/2008/07/mamma-mia-the-movie/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Building a database for your website Part 1</title>
		<link>http://www.php-script.co.uk/2008/07/building-a-database-for-your-website-part-1/</link>
		<comments>http://www.php-script.co.uk/2008/07/building-a-database-for-your-website-part-1/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 14:20:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Databases]]></category>

		<guid isPermaLink="false">http://www.php-script.co.uk/?p=13</guid>
		<description><![CDATA[So you want a database for your website, so where do you start?

When I started to write this, I thought just a few lines with all the big bullet points in would do but after hitting 4 pages in ms word , I decided to split it down so here is  Part1

Database Design for [...]]]></description>
			<content:encoded><![CDATA[<p>So you want a database for your website, so where do you start?</p>
<p>
When I started to write this, I thought just a few lines with all the big bullet points in would do but after hitting 4 pages in ms word , I decided to split it down so here is  Part1
</p>
<h2>Database Design for the Internet 101 Part1</h2>
<p>
Firstly you need to decide what information you will need?  Sounds obvious but you don’t want to go down the spaghetti programming methodology if you can help it as it will cause you problems later on. So the best place to start is a blank A4 piece of paper and create an ERD.
</p>
<p>
An ERD is a graphical representation of the Database, where you can see the Relationships between the data you want to store. Drawing it out has a lot of advantages as you can chop and change it about very easily at the start before you build the database.<br />
<img class="aligncenter" src="/images/example-erd.gif" title="Example small ERD " />
</p>
<p>In these diagrams you can use the infinity sign to indicate a 1 to many relationship and lines to link fields. So as you can see from the example diagram above for each Registration you can have multiple payments.</p>
<p>
In the Payments table there is a field called RegistrationID which links to the RegistratioinID in the Registration table. And then in the Payments table there is a Payment type which links to the Payments type table.</p>
<p>
So why layout the data like this? Its all about data integrity, take the above example, if every time a payment was made the user had to enter a card type there could be all sorts of variations and typos in the table for example “VISA”, “Visa”,” VISA”,”Visa “, “Bisa”   so by adding a PaymentsType table, this gives them the ability to select from a know and verified list. Going through this process is database normalization, for a database to work well you want to get to what is called the third nominal form where no data is replicated.
</p>
<p>
There ends Part 1, Part to will cover more on data relationships and normalization.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-script.co.uk/2008/07/building-a-database-for-your-website-part-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Do I need to do SEO Search Engine Optimisation</title>
		<link>http://www.php-script.co.uk/2008/07/do-i-need-to-do-seo-search-engine-optimisation/</link>
		<comments>http://www.php-script.co.uk/2008/07/do-i-need-to-do-seo-search-engine-optimisation/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 09:30:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Optimised Website Designs]]></category>

		<guid isPermaLink="false">http://www.php-script.co.uk/?p=11</guid>
		<description><![CDATA[It’s not a resounding “YES” as you might think.
If your business is on the brink of closing then there are better ways to get exposure and possible sales over the Internet other than SEO.
These include PPC and traditional marketing activities.   Another reason is that you are planning to totally change your website in [...]]]></description>
			<content:encoded><![CDATA[<p>It’s not a resounding “YES” as you might think.</p>
<p>If your business is on the brink of closing then there are better ways to get exposure and possible sales over the Internet other than <dfn title="SEO - Search Engine Optimisation">SEO</dfn>.</p>
<p>These include <dfn title="PPC - Pay Per Click . These include Google Adwords , and Yahoo Search Marketing">PPC</dfn> and traditional marketing activities.   Another reason is that you are planning to totally change your website in the very near future, in this case its better to make sure your new website is written correctly in the first place and that will give you a good base to work from.</p>
<p>Do I need an external company to do my SEO?</p>
<p>99.9% of the techniques can be found by trawling the Internet and by using some common sense.</p>
<p>SEO is not a quick “switch it on” solution. It takes ongoing time, effort and energy.</p>
<p>So it’s a standard business decision whether you can allocate the time to do it your self or where it’s more cost effective to get an external company to do it.</p>
<p>You see companies offering SEO from £100 one off fee; basically these need to be avoided like the plague as just doing a couple of hours work and then never revisiting the site will NOT work.</p>
<p>SEO will take time it’s not an over night fix and should be considered an ongoing project.</p>
<p>We are currently writing a series of documents on <dfn title="DIY Optimisation - Do It Your Self Search Engine Optimisation">DIY Optimisation</dfn> for those people that want to do it for them selves and these should be available in August 2008 so please pop back to read them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-script.co.uk/2008/07/do-i-need-to-do-seo-search-engine-optimisation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to make php code run in .html files</title>
		<link>http://www.php-script.co.uk/2008/07/how-to-make-php-code-run-in-html-files/</link>
		<comments>http://www.php-script.co.uk/2008/07/how-to-make-php-code-run-in-html-files/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 08:34:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP Scripts]]></category>

		<guid isPermaLink="false">http://www.php-script.co.uk/?p=10</guid>
		<description><![CDATA[This is a fairly simple one. If your website is hosted on an Apache Web Server then you can just edit or add a file called .htaccess. Inside this file you will need to add a line 
addType application/x-httpd-php .php .phtml .html
This tells the web server that files ending in .php .phtml and .html are [...]]]></description>
			<content:encoded><![CDATA[<p>This is a fairly simple one. If your website is hosted on an Apache Web Server then you can just edit or add a file called .htaccess. Inside this file you will need to add a line </p>
<p>addType application/x-httpd-php .php .phtml .html</p>
<p>This tells the web server that files ending in .php .phtml and .html are to be checked for PHP code.</p>
<p>By using the .htaccess method you will not need to restart apache to pick up the changes as apache looks for the .htaccess file each time a page is requested.</p>
<p>If you have to create an .htaccess file you will need to make sure the file permissions on it are 644. Or if setting via an ftp package Owner = Read/Write and the Group and Other will be set to READ only.</p>
<p>You should now be able to put <?php ?> sections anywhere in your html pages.</p>
<p>So why would you want to do this? There are a number of reasons, some of which are</p>
<ul>
<li>Standard Header and Footers</li>
<li>Standard Menus</li>
<li>Displaying Date &#038; Time</li>
<li>Displaying information from a database</li>
<ul>
]]></content:encoded>
			<wfw:commentRss>http://www.php-script.co.uk/2008/07/how-to-make-php-code-run-in-html-files/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Get Working Days between 2 dates with PHP</title>
		<link>http://www.php-script.co.uk/2008/06/get-working-days-between-2-dates-with-php/</link>
		<comments>http://www.php-script.co.uk/2008/06/get-working-days-between-2-dates-with-php/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 23:17:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP Scripts]]></category>

		<guid isPermaLink="false">http://www.php-script.co.uk/?p=9</guid>
		<description><![CDATA[We needed to work out the working days between two dates for a small calendar application we had to write. After looking round the net for a few minuets we decided to write a quick function for ourself.
It takes 3 inputs. A From Date (Epoch) , a To Date (Epoch) and an array with Bank [...]]]></description>
			<content:encoded><![CDATA[<p>We needed to work out the working days between two dates for a small calendar application we had to write. After looking round the net for a few minuets we decided to write a quick function for ourself.</p>
<p>It takes 3 inputs. A From Date (Epoch) , a To Date (Epoch) and an array with Bank Holiday dates in it. By the time it has finished it has a variable $WorkingDays with the number of working days in the give range.</p>
<p>The main logic goes like this</p>
<p>while ( $StartTime &lt;= $EndTime ) {<br />
if (<br />
date(&#8221;D&#8221;,$StartTime) == &#8220;Sat&#8221; ||<br />
date(&#8221;D&#8221;,$StartTime) == &#8220;Sun&#8221; ||<br />
array_key_exists(date(&#8221;Ymd&#8221;,$StartTime),$BankHolidays) ) {</p>
<p>$IgnorDays++;</p>
<p>} else {<br />
$WorkingDays++;</p>
<p>}</p>
<p>$StartTime=$StartTime+86400;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-script.co.uk/2008/06/get-working-days-between-2-dates-with-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What is Optimised Website Design</title>
		<link>http://www.php-script.co.uk/2008/06/what-is-optimised-website-design/</link>
		<comments>http://www.php-script.co.uk/2008/06/what-is-optimised-website-design/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 11:18:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Optimised Website Designs]]></category>

		<guid isPermaLink="false">http://www.php-script.co.uk/?p=8</guid>
		<description><![CDATA[Optimised Website Design so what is it?
Optimised Website Design is the process of making a website very easy for search engines to read and catalogue, and yet still making the site easy to use for its intended audience.
The main thing to remember is “Then Content is King”, if your site layout is great but you [...]]]></description>
			<content:encoded><![CDATA[<h2>Optimised Website Design so what is it?</h2>
<p>Optimised Website Design is the process of making a website very easy for search engines to read and catalogue, and yet still making the site easy to use for its intended audience.</p>
<p>The main thing to remember is “Then Content is King”, if your site layout is great but you have little or no relevant content to the search terms your are trying to achieve it will not work.</p>
<p>12 Simple Rules to Follow for an Optimised Website</p>
<ol>
<li>Make sure all the pages are W3C compliant</li>
<li>Make content on each page relate to the page</li>
<li>Make Page name relevant</li>
<li>Use the alt tag on every image</li>
<li>Use the title tag on every href</li>
<li>Use the dfn tag for acronyms</li>
<li>Make sure you can get back to the page you came from</li>
<li>Have appropriate meta tags on the page for the content</li>
<li>Make sure that there are no broken links</li>
<li>Use h1’s and h2’s</li>
<li>Regularly add content. A page a week is good</li>
<li>Keep going and don’t give up, you will get there</li>
</ol>
<p>If you want more information or Free advice please feel free to contact me at Wrekin Web Design <a href="mailto:phpscript@wrekin-webdesign.co.uk">Tony</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-script.co.uk/2008/06/what-is-optimised-website-design/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

