Archive for the ‘php’ Category

Getting Data from CokeBikes

Friday, January 29th, 2016

Just a piece of PHP for getting data from it is in a JSON format at the top of the webpage in JavaScript, I get it out of the webpage using a Regex and then pass it through a JSON decoder in PHP to get the piece I want.



Database PDF Manafacture

Wednesday, December 11th, 2013

Database PDF Manafacture

Their comes a time when people want stuff printed, and no matter what you do, it will still have to be printed, and if your running big events, then that printing can get pretty troublsome, I was involved in building a little bit of a site, where we wanted to reduce people input in to generating printed documents. Essentially taking the copy and pasting out of the job, and as the posh people say “structering the data”.



So this meant HTML form to PHP to Databases and then to PDF’s

I used PDF’s as webpages don’t normally print very well and PDF’s are almost everywhere, they give a nice printed page, which you can print, and the most important thing is people understand them.

Tools used

  • jquery
  • PHP
  • MySQL
  • tcpdf
  • HTML

The jquery was use in form validation, as show in a earler post

PHP was used to process the forms, in the standard way and then insert the code in to the database, but using Prepared statements and stored procedures (

Then using the database and tcpdf (, you could generate pdfs on the fly from the data base, here is a sample of the code below.