"PHP 5.3 was released a few months ago, and along with it come many problems due to the PHP authors' decisions to backport many PHP 6 features into 5.3 and deprecate several oft-required functions.
In so doing, they broke many things..."
They did not just add new warnings of depreciated functions, they "broke"...
Read more »
PHP Advanced
Serious PHP 5.3 Problems
How to install and customize-personalize Zen-Cart
Tutorial help: how to find settings to set up, customize, Zen-Cart Fast.
What Zen-Cart Won't Tell You
Running the installation program is easy. The time consuming part is removing their sample store demo files and changing ZC's settings which are scattered...
Read more »
Delete the Zen-Cart Store Demo files, images, and Data
"How to clean up default install and remove example store related files."
How to remove, or delete, the "Zen Cart demonstration categories and products".
How to Delete all the Zen-Cart Sample Store files, images, and Data.
Install Zen-Cart and choose "NO" to the "Store Demo":
(Would you like to install the Zen Cart demonstration categories...
Read more »
php 5.3: ctype vs. str_ vs. preg; Speed Optimizations
It should be noted that ctype functions are always preferred over regular expressions, and even to some equivalent str_* and is_* functions. This is because of the fact that ctype uses a native C library and thus processes significantly faster.
NOTE: the ereg... functions have been removed from PHP6 {ereg, eregi,...
Read more »
Function: Convert Numbers to Words
This little, recursive, script is to convert a number, an integer, to words. It has an upper limit of 999,999,999 but you can expand or reduce it from there.
Put the function in your include file and try it out.
/*
* Function: number_to_words
* Description: recursive numerics...
Read more »
Stopping Website Visitor Blog Spam
Stopping Website Visitor Comment Spam. (ex: wordpress)
IF you have a blog and want visitors to easily add a comment to an item, you will also get spam - lots of it - unless you, traditionally, forced visitors to create a login before commenting, or you used a captcha. As one guy...
Read more »
Structured display of All Variables in memory
"The function, get_defined_vars(), returns a multidimensional array containing a list of all defined variables at that location in your program."
To get ALL variables, list ALL variables, display ALL variables, in memory and available at the point where you request it, your scope, (not just SESSION variables, everything ... except private function variables - invisible/unavailable...
Read more »
PHP6: Character encoding and other new features
The Internet is converging on UTF-8 for a common / universal character encoding.
Set your apache environment to utf-8 by adding 'AddDefaultCharset utf-8' to your .htaccess. If you do not use apache add 'default_charset utf-8' to your php.ini. You have to do either of them (not both), php will use...
Read more »
SQL db Injection, Cross-Scripting, RFI, and LFI
It is possible for a hacker to enter the following seemingly innocuous text into the UserName textbox to gain entry to the system without having to know a valid user name and password:
' Or 1=1 --
The hacker breaks into the system by injecting malformed SQL into the query. This particular hack works because...
Read more »
Comparing OOP in php, java, and C++
Sample introductory Object Oriented Programming code in
php, java, and C++ showing the similarities and differences.
Never-the-less, OOP, despite all the bragging we hear about it, is a lot more expensive to write and to maintain than clean structured code. The reality of it does not live up to the theory, ...
Read more »
PHP Date Functions
PHP date functions:
Yesterday in 2 formats:
yyyy mm dd = strftime("%Y %m %d", mktime(0,0,0, date("m"), date("d")-1, date("Y")))
yyyy-mm-dd = strftime("%Y-%m-%d", mktime(0,0,0, date("m"), date("d")-1, date("Y")))
1249282800 = mktime(0,0,0, date("m"), date("d")-1, date("Y") )
Last Month = strftime("%A %B %d, %Y", mktime(0,0,0, date("m")-1, date("d"), date("Y")))
The 't' below gives the number of...
Read more »
A few NorthWind MySQL PHP scripts
Note that the dates on the NorthWind data range only across 1 full year, 1997: from July 1996 to May 1998.
Each line of data below comes from 3 files (tables): the orders file, the order-details file, and the customer file. There are also files of employees, products, suppliers,...
Read more »
PHP(6) ASCII / UTF-8, String Handling Issues
There is no, built-in, limitation in string length in PHP. String is a type in PHP and it is a series of characters. A string is an array of (1 byte) characters. PHP has had no native support of Unicode, UTF-8 or otherwise. PHP6 will have native support for...
Read more »