Reusable Drop-down with for loop function

Posted By: Ian on Feb 17, 2014 in PHP, Snippets
Last modified on January 29th, 2015 at 9:31 pm,

I had 5 drop-down lists that all involved numbers that were pulled from a database and originally if i wanted one to go from 1-20 I’d have to write it 20 times! That’s not good coding and takes longer when editing too so now i wrote this which does what i want and might be …

Continue Reading »

Add StyleSheet from Drop Down Menu with jQuery and PHP

Posted By: Ian on Nov 19, 2013 in JQuery, PHP, Snippets
Last modified on January 29th, 2015 at 9:31 pm,

Following on from the Snippet add and remove stylesheets with jquery I now show you how to list all the stylesheets from a folder into a drop down menu and append the selected one to the head.     Yea but i don’t want to use a different folder? No problem simply add your folder path …

Continue Reading »

PDO Database Connection Script with Email on Error

Posted By: Ian on Dec 18, 2012 in PDO, PHP, Snippets
Last modified on May 30th, 2014 at 5:51 pm,

PDO Connection is seen as the way to go it has a lot of advantages over other techniques and today i share with you a script i mostly use for connecting to my databases as for 1 i get an email with the page and section if something goes wrong and for 2 the visitor …

Continue Reading »

List of Avaiable PDO Drivers for your site

Posted By: Ian on Dec 17, 2012 in PDO, PHP, Snippets
Last modified on March 1st, 2014 at 10:26 pm,

PDO (PHP Data Objects) extension for PHP seems to be the way to go for connecting to and accessing databases such as MySQL and with this little snippet you can easily see what PDO drivers are available for your site if any.   PDO comes with PHP 5.1 and above as default.   See …

Continue Reading »

Creating a Database Driven PHP Click Counter

Posted By: Ian on Dec 16, 2012 in Tutorials
Last modified on December 18th, 2012 at 2:13 pm,

Today were going to look at Creating a Database Driven PHP Click Counter for internal and external links so we can see how popular different links are. For example we could use it for monitoring file downloads on our site or seeing which of our external links are clicked on the most. Take a link …

Continue Reading »

Download and Upload Images to your website

Posted By: Ian on Apr 05, 2012 in PHP, Snippets
Last modified on December 9th, 2012 at 9:45 pm,

Most people talk about downloading an image from a website to there computer but there are times when we need to download an image from a website to our website (Via a Link). Which following on from Download images to website I have combined this with an upload script, image proxy script and optional image …

Continue Reading »

Download images to your website

Posted By: Ian on Mar 28, 2012 in PHP, Snippets
Last modified on December 9th, 2012 at 9:35 pm,

Download images to your website from another site. Linking to images is fine if there on your site but not necessarily a good thing if there on someone else’s. WHY? Because for one the site owner of the other site can change the image, alter the size or even delete it. Why this might not …

Continue Reading »

Image Proxy Script

Posted By: Ian on Mar 28, 2012 in PHP, Snippets
Last modified on December 9th, 2012 at 8:01 pm,

If you want to hide the location from which your serving your images from then you need an Image Proxy Script like this. This script utilises several built in php functions:- Lets say you have an image upload script where you let your “untrusted” users upload images to your site and you want to make …

Continue Reading »

PHP Modulus Operator – mysql database example

Posted By: Ian on Feb 02, 2012 in Blog, Snippets
Last modified on February 26th, 2014 at 9:56 pm,

OK well recently whilst doing some work for someone on a classifieds site the man wanted a banner from Banner Bar to show every 5 adverts. But he wanted the banners to be shown in ascending order and only 1 at a time. After some playing around and a nights sleep i finally cracked it …

Continue Reading »

Sort and order php mysql

Posted By: Ian on Dec 19, 2011 in Blog, PHP
Last modified on November 20th, 2013 at 10:27 am,

During the building of Banner Bar version 2 i needed sort and direction to be carried forward to each page and this is what i came up with. So for anyone looking hope it helps. I have included a full working demo and download link below anyone wanting the mysql table just contact me. Using …

Continue Reading »

About This Site

Dreams are built from lines of code well it's true!
If you can dream it you can usually code it.

I have learned so much from other people on the Internet and this site is for me to give back some of what i have learned and hope people can now learn from me.
Have fun and surf safely,

protected by copyscape duplicate content check


Powered by Banner Bar 125