PHP
Used to change HTML characters into ‘safer’ versions… i.e. for use in $_GET[], SQL injection, etc…
htmlspecialchars($myVariable, ENT_QUOTES, 'utf-8');
‘&’ (ampersand) becomes ‘&’
‘”‘ (double quote) becomes ‘"’ when ENT_NOQUOTES is not set.
”’ (single quote) becomes ‘…
Simple enough….
$result = mysql_query('SELECT * FROM table1');
$num_rows = mysql_num_rows($result);
$num_rows returns the number of records returned by the query….
You know those fantastic ‘SEO friendly URLs’ you see on Drupal or WordPress sites? Well, you can use them in bespoke sites too…
I used this recently for The Wedding Industry Awards site where I wanted to use a single PHP page to include different display scripts depending on ‘how many’ variables…
Ever wanted to see the variables in a page? Warning!! It’ll show all of them….
<?php
print_r(get_defined_vars());
?>
Great explanation of how to get Dreamweaver to colour code other file types as PHP, i.e. .module or .install
The instructions are for a recent version (CS5 I think), but the technique is the same for older versions as I'm still using Dreamweaver 8...
http://fronterahouse.com/blog/news/color-code-…