Aug 192013
 

#Example of how to check (validate) the input.
#Read the input and “Check” if it is correct.
#In this case it is checking if the date was input correctly.

read -p "Date (format yyyy-mm-dd): " input
check=$(date +%F)

if [ "$input" == "$check" ]; then
    echo "Right!"
else
    echo "False!"
fi

Source

Mar 312013
 

How would I display BLOB data with PHP? I’ve entered the BLOB into the DB, but how would I retrieve it? Any examples would be great.
sorry, by BLOB, i meant like a picture

Simple example:

$blob_data = “something you’ve got from BLOB field”;

header(‘Content-type: image/jpeg’); // e.g. if it’s JPEG image
echo $blob_data;

Source

Feb 032012
 

PHPExtensionRegistryEnable.reg

Allow PHP scripts to be run from any directory without the need to type the PHP executable or the .PHP extension and all parameters will be supplied to the script for processing.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.php]
@=”phpfile”
“Content Type”=”application/php”

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\phpfile]
@=”PHP Script”
“EditFlags”=dword:00000000
“BrowserFlags”=dword:00000008
“AlwaysShowExt”=””

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\phpfile\DefaultIcon]
@=”C:\\PHP\\php-win.exe,0″

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\phpfile\shell]
@=”Open”

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\phpfile\shell\Open]
@=”&Open”

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\phpfile\shell\Open\command]
@=”\”C:\\PHP\\php.exe\” -f \”%1\” — %~2″

 From: http://www.php.net/manual/en/install.windows.commandline.php