All entries of my technical and business blog.

When is a PHP array not an array?

Arrays, return variables, expressions, OH MY! I recently learned a lesson about array functions in PHP not returning what I thought they would. I had a function that returned the value of array_shift()… and then used it in another function. Unfortunately, this generated a strict error and was causing some issues… As usual, I put together a proof of concept. Lets check out the code example, the error, and then why: (more…)

php

PHP developer's shortcut for optimizing mysql

PHP developers, raise your hand if you run an explain on each MySQL statement you write and use in your apps! Anyone? Ok… 1… 2… that’s it? Yah, I tend to forget that too, but luckily PHP allows us to cheat. Thanks PHP! (more…)

Execute Windows Commands from PHP without blocking

When researching for my live error reporting posting, I tried running some exec and passthru command tests by starting up calc.exe. While they executed the command correctly, I got some weird results in my script … which I suppose now make sense. Lets see how we can start programs in Windows, and not run into the same issues that I did. (more…)

A reminder about triggering errors not in the USER level

I had a function in some of my code that I wanted to trigger a notice error on certain occasions. Unfortunately, it kept halting my script with a Warning instead. Unfortunately, the error handler at that particular block of code was not properly capturing the error string. It runs out that I was triggering an E_NOTICE instead of an E_USER_NOTICE error… (if I would have reviewed the trigger_error manual page, I wouldn’t have made this... (more…)

php

Live Combined Error Reporting for Apache and PHP during Development

So many times during development, I’ve missed little PHP errors because they were 1) on a processing page that was redirected or 2) output inside of a html tag - and rendered invisible. From time to time, I have to go back to my file system and check the php error log to see what happened. The first step to solving this was implementing a custom error handler - which we did at (“the triangle”).... (more…)

Two New useful external tools for Eclipse

In my posting about Integrating PHPDocumentor into Eclipse, I touched on External Tools a bit. The combination of external batch files, the external tools extra options and the console has made my life easier. I’m using two new additional batch files that I’ve written myself and integrated as external tools. These include automated SVN release update and resource refresh and Apache application control (for those who can’t run apache as a service on w32): (more…)

A Better Understanding of Error Reporting in PHP

While working on a website for (“the triangle”), I came to a page running locally that just stopped - blank. This particular website was not using output buffering - so there is no excuse for a blank page. For whatever reason (laziness, stupidity, thursdayness), I haven’t checked my php.ini file for error reporting in the last few months… and for whatever reason a long time ago, I decided to go back to standard error reporting.... (more…)

php

The top 17 ways to help eliminate the Phishing threat

The following is the result of a research project I had done about phishing. Its some best practices and suggestions based upon information from leading security professionals such as white hat security, McAfee, etc. A combination of e-mail security, authentication methods and corporate identity standards are among the suggestions… Here are the top solutions and methods of securing against Phishing: (more…)

⬅ Newer | Older ➡
Page 46 of 50

Get the RSS or use IFTTT for RSS to Email