Over the coming weeks I’m going to be writing some posts on object orientated programming in PHP5, but to get us started there are a few techniques that we need to know, so today I’m going to be looking at …
Continue reading
When we write code we love to format it nicely adding tabs, line breaks and indentations, but the end user isn’t interested in how lovely the source code is, they just want the page content, so this script strips out …
Continue reading
This is just a quick introduction for beginners getting started with PHP and using while loops. You will quickly find that while loops are used regularly to cycle through specific data. So here’s a little code snippet of a simple …
Continue reading
I’m working on a project right now that uses a PHP crontab to run a heavy script, and the problem I faced was the server kept timing out because by default PHP has a time limit for script execution. There’s …
Continue reading
I’ve been away for the last week. My wife and I bought a flat in North London and finally moved in on March 16th. So I’m currently without the internet and won’t have it until the end of March which …
Continue reading
This is a useful script to re-direct Iphone and Ipod users to a specific page. You could use this if your getting a lot of mobile traffic and your current site isn’t optimised for it. Or for branching out and …
Continue reading
Here’s how to use PHP CURL and the TinyURL api to generate tiny urls on the fly. This is a similar tutorial to the one I wrote a while back on using the Twitter API I’ve set the variable $maketiny …
Continue reading
When building a simple form, validation is usually neglected leaving us open to malicious attacks or genuine user error. filter_var is a built in function to PHP 5 that allows you to strip out any unwanted characters and also makes …
Continue reading
PHP is a powerful language that has replaced HTML frames and JavaScript includes in performing the task of including code from one page onto another. Generally PHP includes are used for database connection scripts, functions or classes, to be included …
Continue reading
Mod rewrite is the best tool to rewrite those long and complicated urls. So what do you need to use mod_rewrite? The only thing you need to get started is make sure that the mod_rewrite module is installed in your …
Continue reading
I’ve been looking for a solution to cache heavy pages and just serve a static html version for a little while now, and I’ve found a solution in output buffering. Things to think about It’s not a good idea to …
Continue reading
Internet explorer seems to feel the need to cache everything, which can turn a simple ajax request into an IE nightmare. Add this to the top of your php script, and all your IE Ajax caching problems will be solved! …
Continue reading
Cookies are mainly used to authenticate a users session, they are small packets of data that are stored in the web browser that allow a website to match specific user information to that in the database, thus authenticating the user. …
Continue reading
Twitters new search feature is great for finding interesting people and topics to follow. So i wrote a script to get search results from twitter and display them on your site. This could be integrated into an existing application or …
Continue reading
Here’s an easy way to display a simple percentage graph using PHP to work out the percentages and do the maths and CSS to display the data on our page. Here’s the demo. First you need to copy the CSS …
Continue reading
TWITTER HAS CHANGED ITS API METHOD THIS TUTORIAL WILL NO LONGER WORK. Here’s a simple introduction on using the Twitter API. The API offers many different ways to connect to your details including xml, json, atom, and rss. Im going …
Continue reading
There’s nothing worse than visiting a website with an out of date copyright notice, and there’s a simple way to make sure your always up to date. Just add the line below to display the current year. <? echo date("Y"); …
Continue reading
Here’s a quick piece of code to highlight replies to users in twitter for example @ashleyford this script uses regular expression to find and replace a based on two things. Firstly it checks for a space before the @ symbol …
Continue reading
Designer and web developer, Co-founder and Technical Director at Harkable.com London. Previously I worked at InMobi, Spotify and MySpace. Interests include photography and making short videos. Also an avid F1 fan.
Follow us on Twitter and get in-stream updates.
Subscribe to all the Papermashup tutorials and articles straight to your RSS reader.
Sign up and get all the Papermashup tutorials straight to your inbox.