07813 311253

How to automatically display the current year in php

by Chris on March 29, 2011 for php

<?php
echo date(“Y”); ?>

easy!

How to make a menu link display as active when the navigation is in a php include file

by Chris on March 29, 2011 for php

I always use this bit of code for my navigation links that are part of a php include file.

Whenever the recordset on the particular page (rs_page) is equal to the unique id from the row (in this case 1) it echoes “class=”selected”

 

<?php $pageon = $row_rs_page['page_id']; $pagenumber = “1″; if ($pageon == $pagenumber) {echo ” class=\”selected\”";} ?>

… or another way would be to declare the name of each page using this at the top of your HTML (example ‘servicespage’) :

<?php $page_name = ‘servicespage’; ?>

and use this in your menu file:

<?php if($page_name == ‘servicespage’) echo ‘class=”selected”‘; ?>

How to show part of a webpage if a recordset condition is true

by Chris on January 13, 2011 for php

With a neat bit of php of course! Using the code below you can reveal a section of your page when your recordset’s (yourrecordset) table row (tablerow) is equal to a certain result. I used this to reveal a ‘New Product’ image over the top of a product if the content of the recordset result matched what was‘yourconditionhere’.

<?php if ($row_yourrecordset['tablerow']==”yourconditionhere“){ ?>
Hello World!
<?php } ?>

Drop the Juice – Packaging Design and Brand Identity Feedback

by Chris on November 28, 2010 for Client Testimonials

I contacted Chris Parker to help with my business branding.  Part of his remit was to provide a creative solution within a specified timeframe.  I was elated by Chris’s standard of work. He was able to encapsulate the vision I had required for my product.  He was professional and helpful throughout, even when I was faced with tight deadlines he delivered.

I would without hesitation recommend Chris to potential clients and colleagues.  I look forward to working with him again soon.”
Hester Camilla
dropthejuice.com

How to reformat the date from a MYSQL database with php

by Chris on September 18, 2010 for php

To display a date retrieved from a recordset in a new format (In this case from a recordset ‘rs_news’):

  • <?php echo date(‘d M Y’, strtotime($row_rs_news['date'])); ?>

When inserting the date in your MySQL database from an update form it needs to be in the MySQL format yyyy-mm-dd. To update a record in this format use;

  • GetSQLValueString(date(‘Y-m-d’, strtotime($_POST['date'])), “date”));

How to hide an area of HTML if a recordset result is empty

by Chris on September 18, 2010 for php

A simple bit of code like the one below is all you need. In this case the recordset name is ‘rs_page’ and the table column that is being tested is ‘image’. If there is nothing returned from the query then the area ‘HTML here’ is hidden.

<?php if (!empty($row_rs_page['image'])) {?>

HTML here

<?php }?>

How to delete multiple rows of Spam from your database based on ID

by Chris on September 16, 2010 for php

The answer is a simple line of SQL. Simply run this SQL query on the offending table (in this case ‘warranty_customers’ is the table and the bad entries range from id 279 to 1400). Simples!

DELETE FROM  `warranty_customers` WHERE  `warranty_customers`.`id` >279 LIMIT 1400 ;

If you are using WordPress you can use the line in PhpMyAdmin:

DELETE FROM wp_comments WHERE comment_approved = 0

or if you are using Askimet (where the value of approved may be set to ‘spam’) use this line in phpMyAdmin:

DELETE FROM wp_comments WHERE comment_approved = ‘spam’

Protected: Corporate Presentation for Kenwood UK

by Chris on September 7, 2010 for Identity Design

This post is password protected. To view it please enter your password below:


Guara Viton UK Brand Development

by Chris on September 2, 2010 for Client Testimonials

“Chris helped us rebrand our existing drinks packaging and was spot on with his design work. It was refreshing to work with someone experienced in branding that just ‘gets it’ and could get to key design stages quickly and without any problems. Chris provided us with various creative routes and design options that were all of really high quality – in the end it was a pretty tough choice! The final design was stunning.
Throughout the project Chris was very helpful and backed up every creative decision with good reasoning – In all it was a great result for us to use Chris and I have no hesitation in recommending him to others.”

Chris Gregoriou
Guara Viton UK Brand Manager

Great design is serious

by Chris on August 30, 2010 for Identity Design