Quick tip to create a list page that will read the files from a directory and link to them is super easy. Using scandir to scan a folder then loop through the files and create a series of a links that link to the document.Continue Reading
I’ve just finished reading Building Secure PHP Apps by Ben Edmunds.
A security ebook very well written it’s not a huge book, spans 5 chapters the topics are covered in details and with a wealth of information to digest and research more on the topics should you choose to do so.
What I really liked about this book was the to the point of practical security issues and how to solve them. Most chapters start with a short story illustrating problems that are plausible setting the scene for each chapter.Continue Reading
For an upcoming project I need to be able to dynamically get information about a GitHub repository such as the number of stars, watchers, forks and the repo description and url.
Looking at the API I didn’t see a simple way of doing it so I decided to scrape my repo instead.
Using HTML Dom Parser (http://simplehtmldom.sourceforge.net) the process is simple. First include simple_html_dom.php then setup the url to my repo:Continue Reading
PHP's in_array is useful to determine if an item is in an array but when needing to compare multiple values against in_array no results will be found.
A way round this is to loop through the values and compare each one in turn, this function is pefect that that task.....Continue Reading
Sending HTML emails can be tricky, not all mail clients support the same css. Most ignore external stylesheets, inline styles are the only way to format layouts for maximum compatability.
Applying inline styles to elements can be hard to maintain, this is where Premailer comes in, Premailer can take a file or HTML markup and take any styles inside style tags and place them inside the tags as inline style attributes.
Premailer provides an api to allow usage within your applications. http://premailer.dialect.ca/api
The Premailer API is accessed via an HTTP POST to http://premailer.dialect.ca/api/0.1/documents.Continue Reading
PHP recently announced the released: PHP 7.0.0 Beta 1, PHP 5.5.27 & PHP 5.6.11.
As with any beta version it’s not suitable to be used for production, test these out on a development server, find any bugs reports them on PHP’s Bug Tracker
The next beta is expected to be relased on the 23rd of July 2015Continue Reading
Today I’ve been to a very special Code Club assembly, to present a certificate to my class for completed their first term. This term we covered a program called Scratch which helps to teach the basic concepts of programming in a fun way by creating interactive games.Continue Reading