I accidentally reused the variable name $count twice in a function.
This is an example template file that will export articles from your bespoke CMS to and XML file that WordPress version 3.5 will import.
I swiped this code from php.net.
For the past few months I've been working on web apps. The first was a mobile site based on jQuery Mobile. While it was "cool", it quickly dawned on me that it wouldn't get any significant usership. For one, it was like a clone of 4square and Scvngr - and who really uses that? I'd peer into the lists of checkins, and it wasn't looking too encouraging. People use it when they're bored and alone, and my scenario didn't involve either of those situations.
It took a while to wrap my mind around PHP namespaces - despite the fact I've needed them for years. It's just one of those features that seems weirder in PHP than in other systems. But that's normal for PHP - quirky. Unfortunately, it's not quirky like Perl, where the quirk eventually makes you feel good. With PHP you just feel kind of odd, maybe a little inferior... like your language is slipping toward becoming the Visual Basic of the web.
What a pain in the ass. Drupal updates look so slick when they work, but when they fail, it's a nightmare. I ended up reverting to a backup and doing it by the book (which seems to matter a lot), and lost a few posts. Oh well. They were mostly programming posts so the code's around somewhere, and probably slightly improved, and may end up on here again.
This seems to happen a lot - and it took several searches and many pages of reading to find the solution. This page will try to even the odds a little more.
I got hacked (more than once) and they installed a backdoor php shell. It sucked (and I must suck for allowing it to happen...
This is a demo of a technique to transmit password encrypted. It's not a perfect solution yet, but it's getting there.
For years (and years) we've done data validation in PHP "by hand" either with string functions or with regular expressions. The problem with PHP has been that, well, PHP programmers aren't so great at regexs. Also, unlike Perl, there's no data tainting feature that forces you to validate your inputs before they're used in expressions. The upshot is that a lot of bad data gets through. PHP finally added some data validation function, but it seems like nobody is using them. It still lacks tainting. The former problem, we can address.
First is the "go to file" feature.
This is a list of links to articles about OOP in PHP. I need to read up on it. Though I know the OO features (most of them at least) I wanted to read some code.
Some themes add a copyright notice using a technique also seen in hack scripts. They take the PHP code, and the base64 encode it, and gzip it.