Snippets

Email admin on script install Automatically

Posted By: Ian on Feb 01, 2015 in PHP, Snippets

Question OK i have a script i wrote which people can use on there sites as longs they link back to my site, but they nearly never do! I don’t want them to be forced to fill out anything as then they might not bother with my script but how can i increase the odds …

Continue Reading »

Click Through Rate script

Posted By: Ian on Feb 01, 2015 in PHP, Snippets

Question How does Banner Bar work out the Click Through Rate CTR for the banners on my site. Answer Demo

Continue Reading »

Version update checker script

Posted By: Ian on Jan 31, 2015 in PHP, Snippets

Question How can i get my script to check my site for updates? Answer The script below checks the local version number against the remote one and if the local is lower than the remote it shows the update link else just shows the current version number. <?php /* local script version */ define('version', '2.1.0'); …

Continue Reading »

Extract data from HTML to XML, import to Google Sheets

Posted By: Ian on Jan 30, 2015 in PHP, Snippets, XML

Question I use Google sheets as a daily menu system for residents in a home and it works great but now the good old EU Food Information for Consumers Regulation (1169/2011) means i have to be able to show whats in each of our dishes. Answer The “Top 14” allergens according to them are Celery  …

Continue Reading »

Extract Text Node from parent ignoring duplicates

Posted By: Ian on Jan 30, 2015 in PHP, Snippets, XML

Question Each recipe in recipes.xml is in a category and i want to print a list of the category’s used without having lots of duplicates how can i do that? Answer Demo xtract-node-xml.php

Continue Reading »

Extract and split node by comma and save to new XML file

Posted By: Ian on Jan 30, 2015 in PHP, Snippets, XML

Question Using Extract specific xml data and save to new xml i can extract specific nodes but what if the text node is a CSV.  As some recipes can be in more than 1 category. Answer XML multi-category.xml Demo split-node-xml.php

Continue Reading »

Extract specific XML data and save into new XML file

Posted By: Ian on Jan 29, 2015 in PHP, Snippets

Question Using Extract specific xml data and save to new xml i can extract specific nodes but what if the text node is a CSV.  As some recipes can be in more than 1 category. Answer XML multi-category.xml Demo split-node-xml.php

Continue Reading »

Validate URL and Email function using PHP Filters

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

In PHP 5.2 filter functions come installed and enabled by default and today were going to use two of them, one to validate URLs and the other email addresses, replacing the need to use regular expressions like preg_match. For the purpose of this demonstration <?php $email = “ianjgough@aol.com”; $url = “http://ianjgough.com”;   function validate($type, $value) …

Continue Reading »

Remote Meta Tag and Title Script

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

Today i share the basics of MetaTagGrabber.com (Which i own) which is a script for extracting the following from a remote webpage: – Using fopen is only good if it’s enabled in your php.ini else you should probably use CURL <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" …

Continue Reading »

Adding expiry date to database from drop-down list

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

In Banner Bar you set the expiry date from a drop-down list and the issue is that the user has to see one thing and the database another. Before i did it a very long winded way but like most things i try to do on here now “Write Less Do More” so here is …

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,
Ian.J.Gough

protected by copyscape duplicate content check

Categories


Powered by Banner Bar 125