Real simple little function will grab the $_GET[]
values and put them into an array for use with jQuery
. I didn't write it and sorry but do not remember where it came from but man has it been usefull at times.
thanks to the original author!
Real simple little function will grab the $_GET[]
values and put them into an array for use with jQuery
. I didn't write it and sorry but do not remember where it came from but man has it been usefull at times.
thanks to the original author!
So you whant to flood the market with another scrolling slideshow, popup, video enabled jQuery plugin. Here is the syntax plain and simple.
(function($){
$.fn.myfunction(settings){
Used to use MySQL
then found out it was being depreciated, this is of course right after I got the hang of it and was almost finished with the project i was using to learn myself. So desided to make the switch to PDO
way much easier especially if you have security in mind.
For instance instead of $var = mysql_real_escape_string($_POST['data'];
, you just $var = $db->quote($_POST['data'];
. Or even better use prepared staements and the underlying driver will not only escape but quote the string for you!
session_start();
at the begginging of document before any HTML
or PHP
.$_SESSION['varName'] = "value";
, it will be available on anypage that has sessions active.unset($_SESSION['varName']);
or unset all with session_unset();
session will still be active though.<php? | |
//fun helper function for debugging from http://net.tutsplus.com/tutorials/tools-and-tips/xdebug-professional-php-debugging/ | |
function dump($value) { | |
echo ‘<pre>'; | |
var_dump($value); | |
echo ‘</pre>'; | |
} | |
?> |
snippet to open a file, write to it (with timestamp), then close file with PHP
More can be found at fopen docs
# ###################################################################### | |
# This below is extracted from the HTML5 boilerplate htaccess file. # | |
# ###################################################################### | |
# | |
# Apache Server Configs v3.0.0 | MIT License | |
# https://github.com/h5bp/server-configs-apache | |
# (!) Using `.htaccess` files slows down Apache, therefore, if you have | |
# access to the main server configuration file (which is usually called | |
# `httpd.conf`), you should add this logic there. |